@atlaskit/editor-common 106.8.0 → 106.9.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 +23 -0
- package/dist/cjs/element-browser/components/ElementList/ElementList.js +3 -1
- package/dist/cjs/element-browser/components/ElementList/EmptyState.js +23 -13
- package/dist/cjs/element-browser/components/StatelessElementBrowser.js +11 -2
- package/dist/cjs/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +47 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/PanelTextInput/styles.js +7 -5
- package/dist/es2019/element-browser/components/ElementList/ElementList.js +3 -1
- package/dist/es2019/element-browser/components/ElementList/EmptyState.js +11 -1
- package/dist/es2019/element-browser/components/StatelessElementBrowser.js +9 -2
- package/dist/es2019/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +50 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/PanelTextInput/styles.js +7 -5
- package/dist/esm/element-browser/components/ElementList/ElementList.js +3 -1
- package/dist/esm/element-browser/components/ElementList/EmptyState.js +11 -1
- package/dist/esm/element-browser/components/StatelessElementBrowser.js +11 -2
- package/dist/esm/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +47 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/PanelTextInput/styles.js +7 -5
- package/dist/types/element-browser/components/ElementList/ElementList.d.ts +1 -0
- package/dist/types/element-browser/components/ElementList/EmptyState.d.ts +2 -1
- package/dist/types/element-browser/hooks/use-select-and-focus-on-arrow-navigation.d.ts +2 -0
- package/dist/types-ts4.5/element-browser/components/ElementList/ElementList.d.ts +1 -0
- package/dist/types-ts4.5/element-browser/components/ElementList/EmptyState.d.ts +2 -1
- package/dist/types-ts4.5/element-browser/hooks/use-select-and-focus-on-arrow-navigation.d.ts +2 -0
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 106.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#171632](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/171632)
|
|
8
|
+
[`09ed62f7d97de`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/09ed62f7d97de) -
|
|
9
|
+
[ux] EDITOR-937 - Update legacy link picker input color contrast
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 106.9.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#170137](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/170137)
|
|
17
|
+
[`dbb4a990de7c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dbb4a990de7c9) -
|
|
18
|
+
[ux] Addressed accessibility issue where the link "Explore Atlassian Marketplace" in Create Issue
|
|
19
|
+
modal for Description > Insert elements was not accessible in case of empty search results. No
|
|
20
|
+
change to existing functionality.
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 106.8.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
|
@@ -63,6 +63,7 @@ function ElementList(_ref) {
|
|
|
63
63
|
mode = _ref.mode,
|
|
64
64
|
selectedItemIndex = _ref.selectedItemIndex,
|
|
65
65
|
focusedItemIndex = _ref.focusedItemIndex,
|
|
66
|
+
focusOnEmptyStateButton = _ref.focusOnEmptyStateButton,
|
|
66
67
|
columnCount = _ref.columnCount,
|
|
67
68
|
setColumnCount = _ref.setColumnCount,
|
|
68
69
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
@@ -133,7 +134,8 @@ function ElementList(_ref) {
|
|
|
133
134
|
selectedCategory: selectedCategory,
|
|
134
135
|
searchTerm: searchTerm
|
|
135
136
|
}) : (0, _react2.jsx)(_EmptyState.default, {
|
|
136
|
-
onExternalLinkClick: onExternalLinkClick
|
|
137
|
+
onExternalLinkClick: onExternalLinkClick,
|
|
138
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton
|
|
137
139
|
}) : (0, _react2.jsx)(_react.Fragment, null, containerWidth > 0 && (0, _react2.jsx)(_AutoSizer.AutoSizer, {
|
|
138
140
|
disableWidth: true
|
|
139
141
|
}, function (_ref3) {
|
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = EmptyState;
|
|
8
|
-
var _react = require("
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
9
10
|
var _reactIntlNext = require("react-intl-next");
|
|
10
11
|
var _new = require("@atlaskit/button/new");
|
|
11
12
|
var _primitives = require("@atlaskit/primitives");
|
|
@@ -14,49 +15,58 @@ var _NotFoundIllustration = _interopRequireDefault(require("./NotFoundIllustrati
|
|
|
14
15
|
* @jsxRuntime classic
|
|
15
16
|
* @jsx jsx
|
|
16
17
|
*/
|
|
18
|
+
|
|
17
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
20
|
|
|
19
21
|
function EmptyState(_ref) {
|
|
20
|
-
var onExternalLinkClick = _ref.onExternalLinkClick
|
|
21
|
-
|
|
22
|
+
var onExternalLinkClick = _ref.onExternalLinkClick,
|
|
23
|
+
focusOnEmptyStateButton = _ref.focusOnEmptyStateButton;
|
|
24
|
+
var buttonRef = (0, _react.useRef)(null);
|
|
25
|
+
(0, _react.useEffect)(function () {
|
|
26
|
+
if (focusOnEmptyStateButton && buttonRef.current) {
|
|
27
|
+
buttonRef.current.focus();
|
|
28
|
+
}
|
|
29
|
+
}, [focusOnEmptyStateButton]);
|
|
30
|
+
return (0, _react2.jsx)("div", {
|
|
22
31
|
css: emptyStateWrapper,
|
|
23
32
|
"data-testid": "empty-state-wrapper"
|
|
24
|
-
}, (0,
|
|
33
|
+
}, (0, _react2.jsx)(_NotFoundIllustration.default, null), (0, _react2.jsx)("div", {
|
|
25
34
|
css: emptyStateHeading
|
|
26
|
-
}, (0,
|
|
35
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, {
|
|
27
36
|
id: "fabric.editor.elementbrowser.search.empty-state.heading",
|
|
28
37
|
defaultMessage: "Nothing matches your search",
|
|
29
38
|
description: "Empty state heading"
|
|
30
|
-
})), (0,
|
|
39
|
+
})), (0, _react2.jsx)("div", {
|
|
31
40
|
css: emptyStateSubHeading
|
|
32
|
-
}, (0,
|
|
41
|
+
}, (0, _react2.jsx)(_primitives.Text, null, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, {
|
|
33
42
|
id: "fabric.editor.elementbrowser.search.empty-state.sub-heading",
|
|
34
43
|
defaultMessage: "Try searching with a different term or discover new apps for Atlassian products.",
|
|
35
44
|
description: "Empty state sub-heading"
|
|
36
|
-
})), (0,
|
|
45
|
+
})), (0, _react2.jsx)(_primitives.Box, {
|
|
37
46
|
xcss: externalLinkWrapper
|
|
38
|
-
}, (0,
|
|
47
|
+
}, (0, _react2.jsx)(_new.LinkButton, {
|
|
39
48
|
appearance: "primary",
|
|
40
49
|
target: "_blank",
|
|
50
|
+
ref: buttonRef,
|
|
41
51
|
href: "https://marketplace.atlassian.com/search?category=Macros&hosting=cloud&product=confluence",
|
|
42
52
|
onClick: onExternalLinkClick
|
|
43
|
-
}, (0,
|
|
53
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, {
|
|
44
54
|
id: "fabric.editor.elementbrowser.search.empty-state.sub-heading.link",
|
|
45
55
|
defaultMessage: "Explore Atlassian Marketplace",
|
|
46
56
|
description: "Empty state sub-heading external link"
|
|
47
57
|
})))));
|
|
48
58
|
}
|
|
49
|
-
var emptyStateHeading = (0,
|
|
59
|
+
var emptyStateHeading = (0, _react2.css)({
|
|
50
60
|
font: "var(--ds-font-heading-medium, normal 500 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
51
61
|
color: "var(--ds-text, rgb(23, 43, 77))",
|
|
52
62
|
marginTop: "var(--ds-space-300, 24px)"
|
|
53
63
|
});
|
|
54
|
-
var emptyStateSubHeading = (0,
|
|
64
|
+
var emptyStateSubHeading = (0, _react2.css)({
|
|
55
65
|
marginTop: "var(--ds-space-200, 16px)",
|
|
56
66
|
maxWidth: '400px',
|
|
57
67
|
textAlign: 'center'
|
|
58
68
|
});
|
|
59
|
-
var emptyStateWrapper = (0,
|
|
69
|
+
var emptyStateWrapper = (0, _react2.css)({
|
|
60
70
|
display: 'flex',
|
|
61
71
|
flexDirection: 'column',
|
|
62
72
|
justifyContent: 'center',
|
|
@@ -167,6 +167,7 @@ function StatelessElementBrowser(props) {
|
|
|
167
167
|
focusedItemIndex = _useSelectAndFocusOnA.focusedItemIndex,
|
|
168
168
|
setFocusedItemIndex = _useSelectAndFocusOnA.setFocusedItemIndex,
|
|
169
169
|
setFocusedCategoryIndex = _useSelectAndFocusOnA.setFocusedCategoryIndex,
|
|
170
|
+
focusOnEmptyStateButton = _useSelectAndFocusOnA.focusOnEmptyStateButton,
|
|
170
171
|
focusedCategoryIndex = _useSelectAndFocusOnA.focusedCategoryIndex,
|
|
171
172
|
focusOnSearch = _useSelectAndFocusOnA.focusOnSearch,
|
|
172
173
|
focusOnViewMore = _useSelectAndFocusOnA.focusOnViewMore,
|
|
@@ -240,6 +241,7 @@ function StatelessElementBrowser(props) {
|
|
|
240
241
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
241
242
|
, (0, _extends2.default)({}, props, {
|
|
242
243
|
selectedItemIndex: selectedItemIndex,
|
|
244
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
243
245
|
focusedItemIndex: focusedItemIndex,
|
|
244
246
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
245
247
|
focusedCategoryIndex: focusedCategoryIndex,
|
|
@@ -259,6 +261,7 @@ function StatelessElementBrowser(props) {
|
|
|
259
261
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
260
262
|
, (0, _extends2.default)({}, props, {
|
|
261
263
|
selectedItemIndex: selectedItemIndex,
|
|
264
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
262
265
|
focusedItemIndex: focusedItemIndex,
|
|
263
266
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
264
267
|
focusOnSearch: focusOnSearch,
|
|
@@ -301,7 +304,9 @@ function MobileBrowser(_ref) {
|
|
|
301
304
|
emptyStateHandler = _ref.emptyStateHandler,
|
|
302
305
|
viewMoreItem = _ref.viewMoreItem,
|
|
303
306
|
onViewMore = _ref.onViewMore,
|
|
304
|
-
cache = _ref.cache
|
|
307
|
+
cache = _ref.cache,
|
|
308
|
+
_ref$focusOnEmptyStat = _ref.focusOnEmptyStateButton,
|
|
309
|
+
focusOnEmptyStateButton = _ref$focusOnEmptyStat === void 0 ? false : _ref$focusOnEmptyStat;
|
|
305
310
|
return (
|
|
306
311
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
307
312
|
(0, _react2.jsx)("div", {
|
|
@@ -338,6 +343,7 @@ function MobileBrowser(_ref) {
|
|
|
338
343
|
onInsertItem: onInsertItem,
|
|
339
344
|
selectedItemIndex: selectedItemIndex,
|
|
340
345
|
focusedItemIndex: focusedItemIndex,
|
|
346
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
341
347
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
342
348
|
columnCount: columnCount,
|
|
343
349
|
setColumnCount: setColumnCount,
|
|
@@ -380,7 +386,9 @@ function DesktopBrowser(_ref2) {
|
|
|
380
386
|
searchTerm = _ref2.searchTerm,
|
|
381
387
|
createAnalyticsEvent = _ref2.createAnalyticsEvent,
|
|
382
388
|
emptyStateHandler = _ref2.emptyStateHandler,
|
|
383
|
-
cache = _ref2.cache
|
|
389
|
+
cache = _ref2.cache,
|
|
390
|
+
_ref2$focusOnEmptySta = _ref2.focusOnEmptyStateButton,
|
|
391
|
+
focusOnEmptyStateButton = _ref2$focusOnEmptySta === void 0 ? false : _ref2$focusOnEmptySta;
|
|
384
392
|
return (0, _react2.jsx)("div", {
|
|
385
393
|
css: elementBrowserContainer,
|
|
386
394
|
"data-testid": "desktop__element-browser"
|
|
@@ -431,6 +439,7 @@ function DesktopBrowser(_ref2) {
|
|
|
431
439
|
onInsertItem: onInsertItem,
|
|
432
440
|
selectedItemIndex: selectedItemIndex,
|
|
433
441
|
focusedItemIndex: focusedItemIndex,
|
|
442
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
434
443
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
435
444
|
columnCount: columnCount,
|
|
436
445
|
setColumnCount: setColumnCount,
|
|
@@ -8,6 +8,7 @@ exports.ensureSafeIndex = exports.default = exports.ACTIONS = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
14
|
/**
|
|
@@ -161,6 +162,30 @@ var moveReducer = function moveReducer(state, action) {
|
|
|
161
162
|
selectedItemIndex: _selectedItemIndex
|
|
162
163
|
});
|
|
163
164
|
}
|
|
165
|
+
if ((0, _platformFeatureFlags.fg)('jfp_a11y_fix_create_issue_no_results_link_focus')) {
|
|
166
|
+
// Handle empty state navigation
|
|
167
|
+
if (state.listSize === -1) {
|
|
168
|
+
// If currently on search, ArrowDown and ArrowUp moves to EmptyState button
|
|
169
|
+
if (state.focusOnSearch && action.payload.positions && action.payload.positions > 0) {
|
|
170
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
171
|
+
focusOnSearch: false,
|
|
172
|
+
focusOnEmptyStateButton: true
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
// If currently on EmptyState button, ArrowUp and ArrowDown moves back to search
|
|
176
|
+
if (state.focusOnEmptyStateButton && action.payload.positions && action.payload.positions < 0) {
|
|
177
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
178
|
+
focusOnSearch: true,
|
|
179
|
+
focusOnEmptyStateButton: false
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
// Stay on EmptyState button for other arrows
|
|
183
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
184
|
+
focusOnSearch: false,
|
|
185
|
+
focusOnEmptyStateButton: true
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
164
189
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
165
190
|
focusOnSearch: false,
|
|
166
191
|
focusOnViewMore: false,
|
|
@@ -171,6 +196,7 @@ var moveReducer = function moveReducer(state, action) {
|
|
|
171
196
|
var initialState = {
|
|
172
197
|
focusOnSearch: true,
|
|
173
198
|
focusOnViewMore: false,
|
|
199
|
+
focusOnEmptyStateButton: false,
|
|
174
200
|
selectedItemIndex: 0,
|
|
175
201
|
focusedItemIndex: undefined,
|
|
176
202
|
listSize: 0
|
|
@@ -233,7 +259,8 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
233
259
|
focusedItemIndex = state.focusedItemIndex,
|
|
234
260
|
focusOnSearch = state.focusOnSearch,
|
|
235
261
|
focusOnViewMore = state.focusOnViewMore,
|
|
236
|
-
focusedCategoryIndex = state.focusedCategoryIndex
|
|
262
|
+
focusedCategoryIndex = state.focusedCategoryIndex,
|
|
263
|
+
focusOnEmptyStateButton = state.focusOnEmptyStateButton;
|
|
237
264
|
|
|
238
265
|
// calls if items size changed
|
|
239
266
|
var reset = (0, _react.useCallback)(function (listSize) {
|
|
@@ -310,6 +337,23 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
310
337
|
if (focusOnSearch && avoidKeysWhileSearching.includes(e.key)) {
|
|
311
338
|
return;
|
|
312
339
|
}
|
|
340
|
+
if ((0, _platformFeatureFlags.fg)('jfp_a11y_fix_create_issue_no_results_link_focus')) {
|
|
341
|
+
// Handle empty state navigation
|
|
342
|
+
if (listSize === -1) {
|
|
343
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
344
|
+
e.preventDefault();
|
|
345
|
+
dispatch({
|
|
346
|
+
type: ACTIONS.UPDATE_STATE,
|
|
347
|
+
payload: {
|
|
348
|
+
focusOnSearch: focusOnEmptyStateButton,
|
|
349
|
+
// cycle focus between search and button
|
|
350
|
+
focusOnEmptyStateButton: !focusOnEmptyStateButton // toggle
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
313
357
|
switch (e.key) {
|
|
314
358
|
case '/':
|
|
315
359
|
e.preventDefault();
|
|
@@ -342,7 +386,7 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
342
386
|
return move(e, Math.min(-_nextItem3, -step), step);
|
|
343
387
|
}
|
|
344
388
|
}
|
|
345
|
-
}, [focusOnSearch, setFocusOnSearch, move, selectedItemIndex, itemIsDisabled, listSize, step]);
|
|
389
|
+
}, [focusOnSearch, setFocusOnSearch, move, selectedItemIndex, itemIsDisabled, listSize, step, focusOnEmptyStateButton]);
|
|
346
390
|
(0, _react.useEffect)(function () {
|
|
347
391
|
// To reset selection when user filters
|
|
348
392
|
reset(listSize);
|
|
@@ -352,6 +396,7 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
352
396
|
onKeyDown: onKeyDown,
|
|
353
397
|
focusOnSearch: focusOnSearch,
|
|
354
398
|
focusOnViewMore: focusOnViewMore,
|
|
399
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
355
400
|
setFocusOnSearch: setFocusOnSearch,
|
|
356
401
|
focusedItemIndex: focusedItemIndex,
|
|
357
402
|
setFocusedItemIndex: removeFocusFromSearchAndSetOnItem,
|
|
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "106.
|
|
19
|
+
var packageVersion = "106.9.1";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// Ignored via go/ees007
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "106.
|
|
26
|
+
var packageVersion = "106.9.1";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -14,16 +14,16 @@ var panelTextInput = exports.panelTextInput = (0, _react.css)({
|
|
|
14
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
15
15
|
'input&': {
|
|
16
16
|
background: 'transparent',
|
|
17
|
-
border: "
|
|
18
|
-
borderRadius:
|
|
17
|
+
border: "1px solid ".concat("var(--ds-border-input, #8590A2)"),
|
|
18
|
+
borderRadius: 3,
|
|
19
19
|
boxSizing: 'content-box',
|
|
20
|
-
color: "var(--ds-text
|
|
20
|
+
color: "var(--ds-text, #172B4D)",
|
|
21
21
|
flexGrow: 1,
|
|
22
22
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
23
23
|
fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)(13),
|
|
24
24
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
25
25
|
lineHeight: '20px',
|
|
26
|
-
padding: "var(--ds-space-
|
|
26
|
+
padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-400, 32px)", " ", "var(--ds-space-100, 8px)", " ", "var(--ds-space-100, 8px)"),
|
|
27
27
|
minWidth: '145px',
|
|
28
28
|
/* Hides IE10+ built-in [x] clear input button */
|
|
29
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
@@ -32,7 +32,9 @@ var panelTextInput = exports.panelTextInput = (0, _react.css)({
|
|
|
32
32
|
},
|
|
33
33
|
'&:focus': {
|
|
34
34
|
outline: 'none',
|
|
35
|
-
|
|
35
|
+
backgroundColor: "var(--ds-background-input-pressed, #FFFFFF)",
|
|
36
|
+
borderColor: "var(--ds-border-focused, #388BFF)",
|
|
37
|
+
boxShadow: "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", "var(--ds-border-focused, #388BFF)")
|
|
36
38
|
},
|
|
37
39
|
'&::placeholder': {
|
|
38
40
|
color: "var(--ds-text-subtlest, #626F86)"
|
|
@@ -51,6 +51,7 @@ function ElementList({
|
|
|
51
51
|
mode,
|
|
52
52
|
selectedItemIndex,
|
|
53
53
|
focusedItemIndex,
|
|
54
|
+
focusOnEmptyStateButton,
|
|
54
55
|
columnCount,
|
|
55
56
|
setColumnCount,
|
|
56
57
|
createAnalyticsEvent,
|
|
@@ -121,7 +122,8 @@ function ElementList({
|
|
|
121
122
|
selectedCategory,
|
|
122
123
|
searchTerm
|
|
123
124
|
}) : jsx(EmptyState, {
|
|
124
|
-
onExternalLinkClick: onExternalLinkClick
|
|
125
|
+
onExternalLinkClick: onExternalLinkClick,
|
|
126
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton
|
|
125
127
|
}) : jsx(Fragment, null, containerWidth > 0 && jsx(AutoSizer, {
|
|
126
128
|
disableWidth: true
|
|
127
129
|
}, ({
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
+
import { useEffect, useRef } from 'react';
|
|
6
|
+
|
|
5
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
8
|
import { css, jsx } from '@emotion/react';
|
|
7
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -9,8 +11,15 @@ import { LinkButton } from '@atlaskit/button/new';
|
|
|
9
11
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
10
12
|
import NotFoundIllustration from './NotFoundIllustration';
|
|
11
13
|
export default function EmptyState({
|
|
12
|
-
onExternalLinkClick
|
|
14
|
+
onExternalLinkClick,
|
|
15
|
+
focusOnEmptyStateButton
|
|
13
16
|
}) {
|
|
17
|
+
const buttonRef = useRef(null);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (focusOnEmptyStateButton && buttonRef.current) {
|
|
20
|
+
buttonRef.current.focus();
|
|
21
|
+
}
|
|
22
|
+
}, [focusOnEmptyStateButton]);
|
|
14
23
|
return jsx("div", {
|
|
15
24
|
css: emptyStateWrapper,
|
|
16
25
|
"data-testid": "empty-state-wrapper"
|
|
@@ -31,6 +40,7 @@ export default function EmptyState({
|
|
|
31
40
|
}, jsx(LinkButton, {
|
|
32
41
|
appearance: "primary",
|
|
33
42
|
target: "_blank",
|
|
43
|
+
ref: buttonRef,
|
|
34
44
|
href: "https://marketplace.atlassian.com/search?category=Macros&hosting=cloud&product=confluence",
|
|
35
45
|
onClick: onExternalLinkClick
|
|
36
46
|
}, jsx(FormattedMessage, {
|
|
@@ -156,6 +156,7 @@ function StatelessElementBrowser(props) {
|
|
|
156
156
|
focusedItemIndex,
|
|
157
157
|
setFocusedItemIndex,
|
|
158
158
|
setFocusedCategoryIndex,
|
|
159
|
+
focusOnEmptyStateButton,
|
|
159
160
|
focusedCategoryIndex,
|
|
160
161
|
focusOnSearch,
|
|
161
162
|
focusOnViewMore,
|
|
@@ -230,6 +231,7 @@ function StatelessElementBrowser(props) {
|
|
|
230
231
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
231
232
|
, _extends({}, props, {
|
|
232
233
|
selectedItemIndex: selectedItemIndex,
|
|
234
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
233
235
|
focusedItemIndex: focusedItemIndex,
|
|
234
236
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
235
237
|
focusedCategoryIndex: focusedCategoryIndex,
|
|
@@ -249,6 +251,7 @@ function StatelessElementBrowser(props) {
|
|
|
249
251
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
250
252
|
, _extends({}, props, {
|
|
251
253
|
selectedItemIndex: selectedItemIndex,
|
|
254
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
252
255
|
focusedItemIndex: focusedItemIndex,
|
|
253
256
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
254
257
|
focusOnSearch: focusOnSearch,
|
|
@@ -291,7 +294,8 @@ function MobileBrowser({
|
|
|
291
294
|
emptyStateHandler,
|
|
292
295
|
viewMoreItem,
|
|
293
296
|
onViewMore,
|
|
294
|
-
cache
|
|
297
|
+
cache,
|
|
298
|
+
focusOnEmptyStateButton = false
|
|
295
299
|
}) {
|
|
296
300
|
return (
|
|
297
301
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
@@ -329,6 +333,7 @@ function MobileBrowser({
|
|
|
329
333
|
onInsertItem: onInsertItem,
|
|
330
334
|
selectedItemIndex: selectedItemIndex,
|
|
331
335
|
focusedItemIndex: focusedItemIndex,
|
|
336
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
332
337
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
333
338
|
columnCount: columnCount,
|
|
334
339
|
setColumnCount: setColumnCount,
|
|
@@ -371,7 +376,8 @@ function DesktopBrowser({
|
|
|
371
376
|
searchTerm,
|
|
372
377
|
createAnalyticsEvent,
|
|
373
378
|
emptyStateHandler,
|
|
374
|
-
cache
|
|
379
|
+
cache,
|
|
380
|
+
focusOnEmptyStateButton = false
|
|
375
381
|
}) {
|
|
376
382
|
return jsx("div", {
|
|
377
383
|
css: elementBrowserContainer,
|
|
@@ -423,6 +429,7 @@ function DesktopBrowser({
|
|
|
423
429
|
onInsertItem: onInsertItem,
|
|
424
430
|
selectedItemIndex: selectedItemIndex,
|
|
425
431
|
focusedItemIndex: focusedItemIndex,
|
|
432
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
426
433
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
427
434
|
columnCount: columnCount,
|
|
428
435
|
setColumnCount: setColumnCount,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useReducer, useRef } from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* a custom hook that handles keyboard navigation for Arrow keys based on a
|
|
@@ -164,6 +165,33 @@ const moveReducer = (state, action) => {
|
|
|
164
165
|
selectedItemIndex
|
|
165
166
|
};
|
|
166
167
|
}
|
|
168
|
+
if (fg('jfp_a11y_fix_create_issue_no_results_link_focus')) {
|
|
169
|
+
// Handle empty state navigation
|
|
170
|
+
if (state.listSize === -1) {
|
|
171
|
+
// If currently on search, ArrowDown and ArrowUp moves to EmptyState button
|
|
172
|
+
if (state.focusOnSearch && action.payload.positions && action.payload.positions > 0) {
|
|
173
|
+
return {
|
|
174
|
+
...state,
|
|
175
|
+
focusOnSearch: false,
|
|
176
|
+
focusOnEmptyStateButton: true
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
// If currently on EmptyState button, ArrowUp and ArrowDown moves back to search
|
|
180
|
+
if (state.focusOnEmptyStateButton && action.payload.positions && action.payload.positions < 0) {
|
|
181
|
+
return {
|
|
182
|
+
...state,
|
|
183
|
+
focusOnSearch: true,
|
|
184
|
+
focusOnEmptyStateButton: false
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
// Stay on EmptyState button for other arrows
|
|
188
|
+
return {
|
|
189
|
+
...state,
|
|
190
|
+
focusOnSearch: false,
|
|
191
|
+
focusOnEmptyStateButton: true
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
167
195
|
return {
|
|
168
196
|
...state,
|
|
169
197
|
focusOnSearch: false,
|
|
@@ -175,6 +203,7 @@ const moveReducer = (state, action) => {
|
|
|
175
203
|
const initialState = {
|
|
176
204
|
focusOnSearch: true,
|
|
177
205
|
focusOnViewMore: false,
|
|
206
|
+
focusOnEmptyStateButton: false,
|
|
178
207
|
selectedItemIndex: 0,
|
|
179
208
|
focusedItemIndex: undefined,
|
|
180
209
|
listSize: 0
|
|
@@ -232,7 +261,8 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
232
261
|
focusedItemIndex,
|
|
233
262
|
focusOnSearch,
|
|
234
263
|
focusOnViewMore,
|
|
235
|
-
focusedCategoryIndex
|
|
264
|
+
focusedCategoryIndex,
|
|
265
|
+
focusOnEmptyStateButton
|
|
236
266
|
} = state;
|
|
237
267
|
|
|
238
268
|
// calls if items size changed
|
|
@@ -311,6 +341,23 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
311
341
|
if (focusOnSearch && avoidKeysWhileSearching.includes(e.key)) {
|
|
312
342
|
return;
|
|
313
343
|
}
|
|
344
|
+
if (fg('jfp_a11y_fix_create_issue_no_results_link_focus')) {
|
|
345
|
+
// Handle empty state navigation
|
|
346
|
+
if (listSize === -1) {
|
|
347
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
348
|
+
e.preventDefault();
|
|
349
|
+
dispatch({
|
|
350
|
+
type: ACTIONS.UPDATE_STATE,
|
|
351
|
+
payload: {
|
|
352
|
+
focusOnSearch: focusOnEmptyStateButton,
|
|
353
|
+
// cycle focus between search and button
|
|
354
|
+
focusOnEmptyStateButton: !focusOnEmptyStateButton // toggle
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
314
361
|
switch (e.key) {
|
|
315
362
|
case '/':
|
|
316
363
|
e.preventDefault();
|
|
@@ -343,7 +390,7 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
343
390
|
return move(e, Math.min(-nextItem, -step), step);
|
|
344
391
|
}
|
|
345
392
|
}
|
|
346
|
-
}, [focusOnSearch, setFocusOnSearch, move, selectedItemIndex, itemIsDisabled, listSize, step]);
|
|
393
|
+
}, [focusOnSearch, setFocusOnSearch, move, selectedItemIndex, itemIsDisabled, listSize, step, focusOnEmptyStateButton]);
|
|
347
394
|
useEffect(() => {
|
|
348
395
|
// To reset selection when user filters
|
|
349
396
|
reset(listSize);
|
|
@@ -353,6 +400,7 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
353
400
|
onKeyDown,
|
|
354
401
|
focusOnSearch,
|
|
355
402
|
focusOnViewMore,
|
|
403
|
+
focusOnEmptyStateButton,
|
|
356
404
|
setFocusOnSearch,
|
|
357
405
|
focusedItemIndex,
|
|
358
406
|
setFocusedItemIndex: removeFocusFromSearchAndSetOnItem,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "106.
|
|
4
|
+
const packageVersion = "106.9.1";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "106.
|
|
16
|
+
const packageVersion = "106.9.1";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -7,16 +7,16 @@ export const panelTextInput = css({
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
8
8
|
'input&': {
|
|
9
9
|
background: 'transparent',
|
|
10
|
-
border: `
|
|
11
|
-
borderRadius:
|
|
10
|
+
border: `1px solid ${"var(--ds-border-input, #8590A2)"}`,
|
|
11
|
+
borderRadius: 3,
|
|
12
12
|
boxSizing: 'content-box',
|
|
13
|
-
color: "var(--ds-text
|
|
13
|
+
color: "var(--ds-text, #172B4D)",
|
|
14
14
|
flexGrow: 1,
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
16
16
|
fontSize: relativeFontSizeToBase16(13),
|
|
17
17
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
18
18
|
lineHeight: '20px',
|
|
19
|
-
padding: `${"var(--ds-space-
|
|
19
|
+
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-400, 32px)"} ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"}`,
|
|
20
20
|
minWidth: '145px',
|
|
21
21
|
/* Hides IE10+ built-in [x] clear input button */
|
|
22
22
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
@@ -25,7 +25,9 @@ export const panelTextInput = css({
|
|
|
25
25
|
},
|
|
26
26
|
'&:focus': {
|
|
27
27
|
outline: 'none',
|
|
28
|
-
|
|
28
|
+
backgroundColor: "var(--ds-background-input-pressed, #FFFFFF)",
|
|
29
|
+
borderColor: "var(--ds-border-focused, #388BFF)",
|
|
30
|
+
boxShadow: `inset 0 0 0 ${"var(--ds-border-width, 1px)"} ${"var(--ds-border-focused, #388BFF)"}`
|
|
29
31
|
},
|
|
30
32
|
'&::placeholder': {
|
|
31
33
|
color: "var(--ds-text-subtlest, #626F86)"
|
|
@@ -52,6 +52,7 @@ function ElementList(_ref) {
|
|
|
52
52
|
mode = _ref.mode,
|
|
53
53
|
selectedItemIndex = _ref.selectedItemIndex,
|
|
54
54
|
focusedItemIndex = _ref.focusedItemIndex,
|
|
55
|
+
focusOnEmptyStateButton = _ref.focusOnEmptyStateButton,
|
|
55
56
|
columnCount = _ref.columnCount,
|
|
56
57
|
setColumnCount = _ref.setColumnCount,
|
|
57
58
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
@@ -122,7 +123,8 @@ function ElementList(_ref) {
|
|
|
122
123
|
selectedCategory: selectedCategory,
|
|
123
124
|
searchTerm: searchTerm
|
|
124
125
|
}) : jsx(EmptyState, {
|
|
125
|
-
onExternalLinkClick: onExternalLinkClick
|
|
126
|
+
onExternalLinkClick: onExternalLinkClick,
|
|
127
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton
|
|
126
128
|
}) : jsx(Fragment, null, containerWidth > 0 && jsx(AutoSizer, {
|
|
127
129
|
disableWidth: true
|
|
128
130
|
}, function (_ref3) {
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
+
import { useEffect, useRef } from 'react';
|
|
6
|
+
|
|
5
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
8
|
import { css, jsx } from '@emotion/react';
|
|
7
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -9,7 +11,14 @@ import { LinkButton } from '@atlaskit/button/new';
|
|
|
9
11
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
10
12
|
import NotFoundIllustration from './NotFoundIllustration';
|
|
11
13
|
export default function EmptyState(_ref) {
|
|
12
|
-
var onExternalLinkClick = _ref.onExternalLinkClick
|
|
14
|
+
var onExternalLinkClick = _ref.onExternalLinkClick,
|
|
15
|
+
focusOnEmptyStateButton = _ref.focusOnEmptyStateButton;
|
|
16
|
+
var buttonRef = useRef(null);
|
|
17
|
+
useEffect(function () {
|
|
18
|
+
if (focusOnEmptyStateButton && buttonRef.current) {
|
|
19
|
+
buttonRef.current.focus();
|
|
20
|
+
}
|
|
21
|
+
}, [focusOnEmptyStateButton]);
|
|
13
22
|
return jsx("div", {
|
|
14
23
|
css: emptyStateWrapper,
|
|
15
24
|
"data-testid": "empty-state-wrapper"
|
|
@@ -30,6 +39,7 @@ export default function EmptyState(_ref) {
|
|
|
30
39
|
}, jsx(LinkButton, {
|
|
31
40
|
appearance: "primary",
|
|
32
41
|
target: "_blank",
|
|
42
|
+
ref: buttonRef,
|
|
33
43
|
href: "https://marketplace.atlassian.com/search?category=Macros&hosting=cloud&product=confluence",
|
|
34
44
|
onClick: onExternalLinkClick
|
|
35
45
|
}, jsx(FormattedMessage, {
|
|
@@ -157,6 +157,7 @@ function StatelessElementBrowser(props) {
|
|
|
157
157
|
focusedItemIndex = _useSelectAndFocusOnA.focusedItemIndex,
|
|
158
158
|
setFocusedItemIndex = _useSelectAndFocusOnA.setFocusedItemIndex,
|
|
159
159
|
setFocusedCategoryIndex = _useSelectAndFocusOnA.setFocusedCategoryIndex,
|
|
160
|
+
focusOnEmptyStateButton = _useSelectAndFocusOnA.focusOnEmptyStateButton,
|
|
160
161
|
focusedCategoryIndex = _useSelectAndFocusOnA.focusedCategoryIndex,
|
|
161
162
|
focusOnSearch = _useSelectAndFocusOnA.focusOnSearch,
|
|
162
163
|
focusOnViewMore = _useSelectAndFocusOnA.focusOnViewMore,
|
|
@@ -230,6 +231,7 @@ function StatelessElementBrowser(props) {
|
|
|
230
231
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
231
232
|
, _extends({}, props, {
|
|
232
233
|
selectedItemIndex: selectedItemIndex,
|
|
234
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
233
235
|
focusedItemIndex: focusedItemIndex,
|
|
234
236
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
235
237
|
focusedCategoryIndex: focusedCategoryIndex,
|
|
@@ -249,6 +251,7 @@ function StatelessElementBrowser(props) {
|
|
|
249
251
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
250
252
|
, _extends({}, props, {
|
|
251
253
|
selectedItemIndex: selectedItemIndex,
|
|
254
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
252
255
|
focusedItemIndex: focusedItemIndex,
|
|
253
256
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
254
257
|
focusOnSearch: focusOnSearch,
|
|
@@ -291,7 +294,9 @@ function MobileBrowser(_ref) {
|
|
|
291
294
|
emptyStateHandler = _ref.emptyStateHandler,
|
|
292
295
|
viewMoreItem = _ref.viewMoreItem,
|
|
293
296
|
onViewMore = _ref.onViewMore,
|
|
294
|
-
cache = _ref.cache
|
|
297
|
+
cache = _ref.cache,
|
|
298
|
+
_ref$focusOnEmptyStat = _ref.focusOnEmptyStateButton,
|
|
299
|
+
focusOnEmptyStateButton = _ref$focusOnEmptyStat === void 0 ? false : _ref$focusOnEmptyStat;
|
|
295
300
|
return (
|
|
296
301
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
297
302
|
jsx("div", {
|
|
@@ -328,6 +333,7 @@ function MobileBrowser(_ref) {
|
|
|
328
333
|
onInsertItem: onInsertItem,
|
|
329
334
|
selectedItemIndex: selectedItemIndex,
|
|
330
335
|
focusedItemIndex: focusedItemIndex,
|
|
336
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
331
337
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
332
338
|
columnCount: columnCount,
|
|
333
339
|
setColumnCount: setColumnCount,
|
|
@@ -370,7 +376,9 @@ function DesktopBrowser(_ref2) {
|
|
|
370
376
|
searchTerm = _ref2.searchTerm,
|
|
371
377
|
createAnalyticsEvent = _ref2.createAnalyticsEvent,
|
|
372
378
|
emptyStateHandler = _ref2.emptyStateHandler,
|
|
373
|
-
cache = _ref2.cache
|
|
379
|
+
cache = _ref2.cache,
|
|
380
|
+
_ref2$focusOnEmptySta = _ref2.focusOnEmptyStateButton,
|
|
381
|
+
focusOnEmptyStateButton = _ref2$focusOnEmptySta === void 0 ? false : _ref2$focusOnEmptySta;
|
|
374
382
|
return jsx("div", {
|
|
375
383
|
css: elementBrowserContainer,
|
|
376
384
|
"data-testid": "desktop__element-browser"
|
|
@@ -421,6 +429,7 @@ function DesktopBrowser(_ref2) {
|
|
|
421
429
|
onInsertItem: onInsertItem,
|
|
422
430
|
selectedItemIndex: selectedItemIndex,
|
|
423
431
|
focusedItemIndex: focusedItemIndex,
|
|
432
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
424
433
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
425
434
|
columnCount: columnCount,
|
|
426
435
|
setColumnCount: setColumnCount,
|
|
@@ -3,6 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { useCallback, useEffect, useReducer, useRef } from 'react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* a custom hook that handles keyboard navigation for Arrow keys based on a
|
|
@@ -156,6 +157,30 @@ var moveReducer = function moveReducer(state, action) {
|
|
|
156
157
|
selectedItemIndex: _selectedItemIndex
|
|
157
158
|
});
|
|
158
159
|
}
|
|
160
|
+
if (fg('jfp_a11y_fix_create_issue_no_results_link_focus')) {
|
|
161
|
+
// Handle empty state navigation
|
|
162
|
+
if (state.listSize === -1) {
|
|
163
|
+
// If currently on search, ArrowDown and ArrowUp moves to EmptyState button
|
|
164
|
+
if (state.focusOnSearch && action.payload.positions && action.payload.positions > 0) {
|
|
165
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
166
|
+
focusOnSearch: false,
|
|
167
|
+
focusOnEmptyStateButton: true
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
// If currently on EmptyState button, ArrowUp and ArrowDown moves back to search
|
|
171
|
+
if (state.focusOnEmptyStateButton && action.payload.positions && action.payload.positions < 0) {
|
|
172
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
173
|
+
focusOnSearch: true,
|
|
174
|
+
focusOnEmptyStateButton: false
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
// Stay on EmptyState button for other arrows
|
|
178
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
179
|
+
focusOnSearch: false,
|
|
180
|
+
focusOnEmptyStateButton: true
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
159
184
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
160
185
|
focusOnSearch: false,
|
|
161
186
|
focusOnViewMore: false,
|
|
@@ -166,6 +191,7 @@ var moveReducer = function moveReducer(state, action) {
|
|
|
166
191
|
var initialState = {
|
|
167
192
|
focusOnSearch: true,
|
|
168
193
|
focusOnViewMore: false,
|
|
194
|
+
focusOnEmptyStateButton: false,
|
|
169
195
|
selectedItemIndex: 0,
|
|
170
196
|
focusedItemIndex: undefined,
|
|
171
197
|
listSize: 0
|
|
@@ -228,7 +254,8 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
228
254
|
focusedItemIndex = state.focusedItemIndex,
|
|
229
255
|
focusOnSearch = state.focusOnSearch,
|
|
230
256
|
focusOnViewMore = state.focusOnViewMore,
|
|
231
|
-
focusedCategoryIndex = state.focusedCategoryIndex
|
|
257
|
+
focusedCategoryIndex = state.focusedCategoryIndex,
|
|
258
|
+
focusOnEmptyStateButton = state.focusOnEmptyStateButton;
|
|
232
259
|
|
|
233
260
|
// calls if items size changed
|
|
234
261
|
var reset = useCallback(function (listSize) {
|
|
@@ -305,6 +332,23 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
305
332
|
if (focusOnSearch && avoidKeysWhileSearching.includes(e.key)) {
|
|
306
333
|
return;
|
|
307
334
|
}
|
|
335
|
+
if (fg('jfp_a11y_fix_create_issue_no_results_link_focus')) {
|
|
336
|
+
// Handle empty state navigation
|
|
337
|
+
if (listSize === -1) {
|
|
338
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
339
|
+
e.preventDefault();
|
|
340
|
+
dispatch({
|
|
341
|
+
type: ACTIONS.UPDATE_STATE,
|
|
342
|
+
payload: {
|
|
343
|
+
focusOnSearch: focusOnEmptyStateButton,
|
|
344
|
+
// cycle focus between search and button
|
|
345
|
+
focusOnEmptyStateButton: !focusOnEmptyStateButton // toggle
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
308
352
|
switch (e.key) {
|
|
309
353
|
case '/':
|
|
310
354
|
e.preventDefault();
|
|
@@ -337,7 +381,7 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
337
381
|
return move(e, Math.min(-_nextItem3, -step), step);
|
|
338
382
|
}
|
|
339
383
|
}
|
|
340
|
-
}, [focusOnSearch, setFocusOnSearch, move, selectedItemIndex, itemIsDisabled, listSize, step]);
|
|
384
|
+
}, [focusOnSearch, setFocusOnSearch, move, selectedItemIndex, itemIsDisabled, listSize, step, focusOnEmptyStateButton]);
|
|
341
385
|
useEffect(function () {
|
|
342
386
|
// To reset selection when user filters
|
|
343
387
|
reset(listSize);
|
|
@@ -347,6 +391,7 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
347
391
|
onKeyDown: onKeyDown,
|
|
348
392
|
focusOnSearch: focusOnSearch,
|
|
349
393
|
focusOnViewMore: focusOnViewMore,
|
|
394
|
+
focusOnEmptyStateButton: focusOnEmptyStateButton,
|
|
350
395
|
setFocusOnSearch: setFocusOnSearch,
|
|
351
396
|
focusedItemIndex: focusedItemIndex,
|
|
352
397
|
setFocusedItemIndex: removeFocusFromSearchAndSetOnItem,
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "106.
|
|
10
|
+
var packageVersion = "106.9.1";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "106.
|
|
23
|
+
var packageVersion = "106.9.1";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -7,16 +7,16 @@ export var panelTextInput = css({
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
8
8
|
'input&': {
|
|
9
9
|
background: 'transparent',
|
|
10
|
-
border: "
|
|
11
|
-
borderRadius:
|
|
10
|
+
border: "1px solid ".concat("var(--ds-border-input, #8590A2)"),
|
|
11
|
+
borderRadius: 3,
|
|
12
12
|
boxSizing: 'content-box',
|
|
13
|
-
color: "var(--ds-text
|
|
13
|
+
color: "var(--ds-text, #172B4D)",
|
|
14
14
|
flexGrow: 1,
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
16
16
|
fontSize: relativeFontSizeToBase16(13),
|
|
17
17
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
18
18
|
lineHeight: '20px',
|
|
19
|
-
padding: "var(--ds-space-
|
|
19
|
+
padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-400, 32px)", " ", "var(--ds-space-100, 8px)", " ", "var(--ds-space-100, 8px)"),
|
|
20
20
|
minWidth: '145px',
|
|
21
21
|
/* Hides IE10+ built-in [x] clear input button */
|
|
22
22
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
@@ -25,7 +25,9 @@ export var panelTextInput = css({
|
|
|
25
25
|
},
|
|
26
26
|
'&:focus': {
|
|
27
27
|
outline: 'none',
|
|
28
|
-
|
|
28
|
+
backgroundColor: "var(--ds-background-input-pressed, #FFFFFF)",
|
|
29
|
+
borderColor: "var(--ds-border-focused, #388BFF)",
|
|
30
|
+
boxShadow: "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", "var(--ds-border-focused, #388BFF)")
|
|
29
31
|
},
|
|
30
32
|
'&::placeholder': {
|
|
31
33
|
color: "var(--ds-text-subtlest, #626F86)"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type Props = {
|
|
3
3
|
onExternalLinkClick: () => void;
|
|
4
|
+
focusOnEmptyStateButton?: boolean;
|
|
4
5
|
};
|
|
5
|
-
export default function EmptyState({ onExternalLinkClick }: Props): JSX.Element;
|
|
6
|
+
export default function EmptyState({ onExternalLinkClick, focusOnEmptyStateButton, }: Props): JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -41,6 +41,7 @@ import type React from 'react';
|
|
|
41
41
|
type ReducerState = {
|
|
42
42
|
focusOnSearch: boolean;
|
|
43
43
|
focusOnViewMore: boolean;
|
|
44
|
+
focusOnEmptyStateButton?: boolean;
|
|
44
45
|
selectedItemIndex?: number;
|
|
45
46
|
focusedItemIndex?: number;
|
|
46
47
|
listSize: number;
|
|
@@ -64,6 +65,7 @@ export type useSelectAndFocusReturnType = {
|
|
|
64
65
|
onKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
65
66
|
focusOnSearch: boolean;
|
|
66
67
|
focusOnViewMore: boolean;
|
|
68
|
+
focusOnEmptyStateButton?: boolean;
|
|
67
69
|
focusedItemIndex?: number;
|
|
68
70
|
focusedCategoryIndex?: number;
|
|
69
71
|
setFocusedItemIndex: (index?: number) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type Props = {
|
|
3
3
|
onExternalLinkClick: () => void;
|
|
4
|
+
focusOnEmptyStateButton?: boolean;
|
|
4
5
|
};
|
|
5
|
-
export default function EmptyState({ onExternalLinkClick }: Props): JSX.Element;
|
|
6
|
+
export default function EmptyState({ onExternalLinkClick, focusOnEmptyStateButton, }: Props): JSX.Element;
|
|
6
7
|
export {};
|
package/dist/types-ts4.5/element-browser/hooks/use-select-and-focus-on-arrow-navigation.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ import type React from 'react';
|
|
|
41
41
|
type ReducerState = {
|
|
42
42
|
focusOnSearch: boolean;
|
|
43
43
|
focusOnViewMore: boolean;
|
|
44
|
+
focusOnEmptyStateButton?: boolean;
|
|
44
45
|
selectedItemIndex?: number;
|
|
45
46
|
focusedItemIndex?: number;
|
|
46
47
|
listSize: number;
|
|
@@ -64,6 +65,7 @@ export type useSelectAndFocusReturnType = {
|
|
|
64
65
|
onKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
65
66
|
focusOnSearch: boolean;
|
|
66
67
|
focusOnViewMore: boolean;
|
|
68
|
+
focusOnEmptyStateButton?: boolean;
|
|
67
69
|
focusedItemIndex?: number;
|
|
68
70
|
focusedCategoryIndex?: number;
|
|
69
71
|
setFocusedItemIndex: (index?: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "106.
|
|
3
|
+
"version": "106.9.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -149,10 +149,10 @@
|
|
|
149
149
|
"@atlaskit/media-card": "^79.3.0",
|
|
150
150
|
"@atlaskit/media-client": "^33.4.0",
|
|
151
151
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
152
|
-
"@atlaskit/media-common": "^12.
|
|
152
|
+
"@atlaskit/media-common": "^12.2.0",
|
|
153
153
|
"@atlaskit/media-file-preview": "^0.11.0",
|
|
154
154
|
"@atlaskit/media-picker": "^69.0.0",
|
|
155
|
-
"@atlaskit/media-ui": "^28.
|
|
155
|
+
"@atlaskit/media-ui": "^28.3.0",
|
|
156
156
|
"@atlaskit/media-viewer": "^52.2.0",
|
|
157
157
|
"@atlaskit/mention": "^24.2.0",
|
|
158
158
|
"@atlaskit/menu": "^8.0.0",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
162
162
|
"@atlaskit/popper": "^7.0.0",
|
|
163
163
|
"@atlaskit/primitives": "^14.8.0",
|
|
164
|
-
"@atlaskit/profilecard": "^23.
|
|
164
|
+
"@atlaskit/profilecard": "^23.19.0",
|
|
165
165
|
"@atlaskit/react-ufo": "^3.13.0",
|
|
166
166
|
"@atlaskit/section-message": "^8.2.0",
|
|
167
167
|
"@atlaskit/smart-card": "^38.9.0",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"@atlaskit/task-decision": "^19.2.0",
|
|
171
171
|
"@atlaskit/textfield": "^8.0.0",
|
|
172
172
|
"@atlaskit/theme": "^18.0.0",
|
|
173
|
-
"@atlaskit/tmp-editor-statsig": "^7.
|
|
173
|
+
"@atlaskit/tmp-editor-statsig": "^7.1.0",
|
|
174
174
|
"@atlaskit/tokens": "^5.2.0",
|
|
175
175
|
"@atlaskit/tooltip": "^20.3.0",
|
|
176
176
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -392,6 +392,9 @@
|
|
|
392
392
|
"platform_editor_breakout_resizing_hello_release": {
|
|
393
393
|
"type": "boolean"
|
|
394
394
|
},
|
|
395
|
+
"jfp_a11y_fix_create_issue_no_results_link_focus": {
|
|
396
|
+
"type": "boolean"
|
|
397
|
+
},
|
|
395
398
|
"platform_editor_fix_unsubscribe_of_provider": {
|
|
396
399
|
"type": "boolean"
|
|
397
400
|
}
|