@atlaskit/editor-common 83.0.2 → 83.0.3
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 +8 -0
- package/dist/cjs/keymaps/index.js +4 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui-menu/DropdownMenu/index.js +32 -12
- package/dist/es2019/keymaps/index.js +1 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui-menu/DropdownMenu/index.js +36 -16
- package/dist/esm/keymaps/index.js +1 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui-menu/DropdownMenu/index.js +32 -14
- package/dist/types/keymaps/index.d.ts +1 -0
- package/dist/types/ui-menu/DropdownMenu/index.d.ts +1 -0
- package/dist/types/ui-menu/DropdownMenu/types.d.ts +2 -0
- package/dist/types-ts4.5/keymaps/index.d.ts +1 -0
- package/dist/types-ts4.5/ui-menu/DropdownMenu/index.d.ts +1 -0
- package/dist/types-ts4.5/ui-menu/DropdownMenu/types.d.ts +2 -0
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 83.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#115110](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115110)
|
|
8
|
+
[`c6f8e2be84f70`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6f8e2be84f70) -
|
|
9
|
+
ECA11Y-20/ECA11Y-59 Make table cell options menu accessible for keyboard only users
|
|
10
|
+
|
|
3
11
|
## 83.0.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -87,7 +87,7 @@ exports.findKeyMapForBrowser = findKeyMapForBrowser;
|
|
|
87
87
|
exports.findKeymapByDescription = findKeymapByDescription;
|
|
88
88
|
exports.findShortcutByDescription = findShortcutByDescription;
|
|
89
89
|
exports.findShortcutByKeymap = findShortcutByKeymap;
|
|
90
|
-
exports.forwardDelete = exports.focusTableResizer = void 0;
|
|
90
|
+
exports.forwardDelete = exports.focusToContextMenuTrigger = exports.focusTableResizer = void 0;
|
|
91
91
|
exports.getAriaKeyshortcuts = getAriaKeyshortcuts;
|
|
92
92
|
exports.insertRule = exports.insertNewLine = exports.indentList = exports.indent = exports.increaseMediaSize = void 0;
|
|
93
93
|
exports.isCapsLockOnAndModifyKeyboardEvent = isCapsLockOnAndModifyKeyboardEvent;
|
|
@@ -100,8 +100,8 @@ Object.defineProperty(exports, "keymap", {
|
|
|
100
100
|
exports.makeKeyMapArrayWithCommon = makeKeyMapArrayWithCommon;
|
|
101
101
|
exports.makeKeyMapWithCommon = makeKeyMapWithCommon;
|
|
102
102
|
exports.makeKeymap = makeKeymap;
|
|
103
|
-
exports.
|
|
104
|
-
exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = void 0;
|
|
103
|
+
exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.startColumnResizing = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.shiftTab = exports.shiftEnter = exports.shiftBackspace = exports.shiftArrowUp = exports.setNormalText = exports.selectTable = exports.selectRow = exports.selectColumn = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.navToFloatingToolbar = exports.navToEditorToolbar = exports.moveUp = exports.moveRowUp = exports.moveRowDown = exports.moveRight = exports.moveLeft = exports.moveDown = exports.moveColumnRight = exports.moveColumnLeft = void 0;
|
|
104
|
+
exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = void 0;
|
|
105
105
|
exports.tooltip = tooltip;
|
|
106
106
|
exports.undo = void 0;
|
|
107
107
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -207,6 +207,7 @@ var increaseMediaSize = exports.increaseMediaSize = makeKeyMapWithCommon('increa
|
|
|
207
207
|
var decreaseMediaSize = exports.decreaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-Alt-[');
|
|
208
208
|
var activateVideoControls = exports.activateVideoControls = makeKeyMapWithCommon('Activate controls panel on video', 'Shift-F10');
|
|
209
209
|
var toggleHighlightPalette = exports.toggleHighlightPalette = makeKeyMapWithCommon('Toggle Highlight Palette', 'Mod-Alt-b');
|
|
210
|
+
var focusToContextMenuTrigger = exports.focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table context menu trigger', 'Shift-F10');
|
|
210
211
|
var arrowKeysMap = {
|
|
211
212
|
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
212
213
|
ARROWLEFT: "\u2190",
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "83.0.
|
|
20
|
+
var packageVersion = "83.0.3";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
|
|
|
20
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
21
21
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "83.0.
|
|
23
|
+
var packageVersion = "83.0.3";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -23,6 +23,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
23
23
|
var _react2 = require("@emotion/react");
|
|
24
24
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
25
25
|
var _menu = require("@atlaskit/menu");
|
|
26
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
26
27
|
var _colors = require("@atlaskit/theme/colors");
|
|
27
28
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
28
29
|
var _styles = require("../../styles");
|
|
@@ -62,7 +63,7 @@ var buttonStyles = function buttonStyles(isActive, submenuActive) {
|
|
|
62
63
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t> span,\n\t\t\t> span:hover,\n\t\t\t> span:active {\n\t\t\t\tbackground: ", ";\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t\t:focus > span[aria-disabled='false'] {\n\t\t\t\t", ";\n\t\t\t}\n\t\t\t:focus-visible,\n\t\t\t:focus-visible > span[aria-disabled='false'] {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t"])), "var(--ds-background-selected, #6c798f)", "var(--ds-text, #fff)", focusedMenuItemStyle);
|
|
63
64
|
} else {
|
|
64
65
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
65
|
-
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t> span:hover[aria-disabled='false'] {\n\t\t\t\tcolor: ", ";\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\t", "\n\t\t\t> span[aria-disabled='true'] {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t\t:focus > span[aria-disabled='false'] {\n\t\t\t\t", ";\n\t\t\t}\n\t\t\t:focus-visible,\n\t\t\t:focus-visible > span[aria-disabled='false'] {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t"])), "var(--ds-text, ".concat(_colors.N900, ")"), "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))", !submenuActive && "\n
|
|
66
|
+
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t> span:hover[aria-disabled='false'] {\n\t\t\t\tcolor: ", ";\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\t", "\n\t\t\t> span[aria-disabled='true'] {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t\t:focus > span[aria-disabled='false'] {\n\t\t\t\t", ";\n\t\t\t}\n\t\t\t:focus-visible,\n\t\t\t:focus-visible > span[aria-disabled='false'] {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t"])), "var(--ds-text, ".concat(_colors.N900, ")"), "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))", !submenuActive && "\n\t\t\t\t\t> span:active[aria-disabled='false'] {\n\t\t\t\t\t\tbackground-color: ".concat("var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))", ";\n\t\t\t\t\t}"), "var(--ds-text-disabled, ".concat(_colors.N70, ")"), focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
69
|
var DropListWithOutsideListeners = (0, _uiReact.withReactEditorViewOuterListeners)(_DropList.default);
|
|
@@ -101,16 +102,28 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
|
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
104
|
});
|
|
104
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleCloseAndFocus", function () {
|
|
105
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleCloseAndFocus", function (event) {
|
|
105
106
|
var _this$state$target;
|
|
106
107
|
(_this$state$target = _this.state.target) === null || _this$state$target === void 0 || (_this$state$target = _this$state$target.querySelector('button')) === null || _this$state$target === void 0 || _this$state$target.focus();
|
|
107
|
-
|
|
108
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
109
|
+
_this.handleClose(event);
|
|
110
|
+
} else {
|
|
111
|
+
_this.handleClose();
|
|
112
|
+
}
|
|
108
113
|
});
|
|
109
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClose", function () {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClose", function (event) {
|
|
115
|
+
var onOpenChange = _this.props.onOpenChange;
|
|
116
|
+
if (onOpenChange) {
|
|
117
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
118
|
+
onOpenChange({
|
|
119
|
+
isOpen: false,
|
|
120
|
+
event: event
|
|
121
|
+
});
|
|
122
|
+
} else {
|
|
123
|
+
onOpenChange({
|
|
124
|
+
isOpen: false
|
|
125
|
+
});
|
|
126
|
+
}
|
|
114
127
|
}
|
|
115
128
|
});
|
|
116
129
|
return _this;
|
|
@@ -135,8 +148,8 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
|
|
|
135
148
|
shouldUseDefaultRole = _this$props.shouldUseDefaultRole,
|
|
136
149
|
onItemActivated = _this$props.onItemActivated,
|
|
137
150
|
arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions,
|
|
138
|
-
section = _this$props.section
|
|
139
|
-
|
|
151
|
+
section = _this$props.section,
|
|
152
|
+
isAllowEnterDefaultBehavior = _this$props.isAllowEnterDefaultBehavior;
|
|
140
153
|
// Note that this onSelection function can't be refactored to useMemo for
|
|
141
154
|
// performance gains as it is being used as a dependency in a useEffect in
|
|
142
155
|
// MenuArrowKeyNavigationProvider in order to check for re-renders to adjust
|
|
@@ -179,7 +192,13 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
|
|
|
179
192
|
handleClickOutside: this.handleClose,
|
|
180
193
|
handleEscapeKeydown: this.handleCloseAndFocus,
|
|
181
194
|
handleEnterKeydown: function handleEnterKeydown(e) {
|
|
182
|
-
|
|
195
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
196
|
+
if (!isAllowEnterDefaultBehavior) {
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
e.preventDefault();
|
|
201
|
+
}
|
|
183
202
|
e.stopPropagation();
|
|
184
203
|
},
|
|
185
204
|
targetRef: this.state.target
|
|
@@ -316,7 +335,8 @@ function DropdownMenuItem(_ref) {
|
|
|
316
335
|
return _onMouseLeave && _onMouseLeave({
|
|
317
336
|
item: item
|
|
318
337
|
});
|
|
319
|
-
}
|
|
338
|
+
},
|
|
339
|
+
"aria-expanded": (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') ? item['aria-expanded'] : undefined
|
|
320
340
|
}, item.content));
|
|
321
341
|
if (item.tooltipDescription) {
|
|
322
342
|
var _item$key3;
|
|
@@ -95,6 +95,7 @@ export const increaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mo
|
|
|
95
95
|
export const decreaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-Alt-[');
|
|
96
96
|
export const activateVideoControls = makeKeyMapWithCommon('Activate controls panel on video', 'Shift-F10');
|
|
97
97
|
export const toggleHighlightPalette = makeKeyMapWithCommon('Toggle Highlight Palette', 'Mod-Alt-b');
|
|
98
|
+
export const focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table context menu trigger', 'Shift-F10');
|
|
98
99
|
const arrowKeysMap = {
|
|
99
100
|
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
100
101
|
ARROWLEFT: '\u2190',
|
|
@@ -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 = "83.0.
|
|
4
|
+
const packageVersion = "83.0.3";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -9,7 +9,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
9
9
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
10
10
|
import Layer from '../Layer';
|
|
11
11
|
const packageName = "@atlaskit/editor-common";
|
|
12
|
-
const packageVersion = "83.0.
|
|
12
|
+
const packageVersion = "83.0.3";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
|
|
5
4
|
import React, { PureComponent, useContext } from 'react';
|
|
6
|
-
|
|
7
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
6
|
import { css, jsx } from '@emotion/react';
|
|
9
7
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
10
8
|
import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
9
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { B100, N70, N900 } from '@atlaskit/theme/colors';
|
|
12
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
12
|
import { DropdownMenuSharedCssClassName } from '../../styles';
|
|
@@ -57,9 +56,9 @@ const buttonStyles = (isActive, submenuActive) => {
|
|
|
57
56
|
background-color: ${"var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))"};
|
|
58
57
|
}
|
|
59
58
|
${!submenuActive && `
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
> span:active[aria-disabled='false'] {
|
|
60
|
+
background-color: ${"var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))"};
|
|
61
|
+
}`}
|
|
63
62
|
> span[aria-disabled='true'] {
|
|
64
63
|
color: ${`var(--ds-text-disabled, ${N70})`};
|
|
65
64
|
}
|
|
@@ -104,16 +103,30 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
105
|
});
|
|
107
|
-
_defineProperty(this, "handleCloseAndFocus",
|
|
106
|
+
_defineProperty(this, "handleCloseAndFocus", event => {
|
|
108
107
|
var _this$state$target, _this$state$target$qu;
|
|
109
108
|
(_this$state$target = this.state.target) === null || _this$state$target === void 0 ? void 0 : (_this$state$target$qu = _this$state$target.querySelector('button')) === null || _this$state$target$qu === void 0 ? void 0 : _this$state$target$qu.focus();
|
|
110
|
-
|
|
109
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
110
|
+
this.handleClose(event);
|
|
111
|
+
} else {
|
|
112
|
+
this.handleClose();
|
|
113
|
+
}
|
|
111
114
|
});
|
|
112
|
-
_defineProperty(this, "handleClose",
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
_defineProperty(this, "handleClose", event => {
|
|
116
|
+
const {
|
|
117
|
+
onOpenChange
|
|
118
|
+
} = this.props;
|
|
119
|
+
if (onOpenChange) {
|
|
120
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
121
|
+
onOpenChange({
|
|
122
|
+
isOpen: false,
|
|
123
|
+
event: event
|
|
124
|
+
});
|
|
125
|
+
} else {
|
|
126
|
+
onOpenChange({
|
|
127
|
+
isOpen: false
|
|
128
|
+
});
|
|
129
|
+
}
|
|
117
130
|
}
|
|
118
131
|
});
|
|
119
132
|
}
|
|
@@ -135,9 +148,9 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
135
148
|
shouldUseDefaultRole,
|
|
136
149
|
onItemActivated,
|
|
137
150
|
arrowKeyNavigationProviderOptions,
|
|
138
|
-
section
|
|
151
|
+
section,
|
|
152
|
+
isAllowEnterDefaultBehavior
|
|
139
153
|
} = this.props;
|
|
140
|
-
|
|
141
154
|
// Note that this onSelection function can't be refactored to useMemo for
|
|
142
155
|
// performance gains as it is being used as a dependency in a useEffect in
|
|
143
156
|
// MenuArrowKeyNavigationProvider in order to check for re-renders to adjust
|
|
@@ -181,7 +194,13 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
181
194
|
handleClickOutside: this.handleClose,
|
|
182
195
|
handleEscapeKeydown: this.handleCloseAndFocus,
|
|
183
196
|
handleEnterKeydown: e => {
|
|
184
|
-
|
|
197
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
198
|
+
if (!isAllowEnterDefaultBehavior) {
|
|
199
|
+
e.preventDefault();
|
|
200
|
+
}
|
|
201
|
+
} else {
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
}
|
|
185
204
|
e.stopPropagation();
|
|
186
205
|
},
|
|
187
206
|
targetRef: this.state.target
|
|
@@ -303,7 +322,8 @@ export function DropdownMenuItem({
|
|
|
303
322
|
}),
|
|
304
323
|
onMouseLeave: () => onMouseLeave && onMouseLeave({
|
|
305
324
|
item
|
|
306
|
-
})
|
|
325
|
+
}),
|
|
326
|
+
"aria-expanded": getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? item['aria-expanded'] : undefined
|
|
307
327
|
}, item.content));
|
|
308
328
|
if (item.tooltipDescription) {
|
|
309
329
|
var _item$key3;
|
|
@@ -96,6 +96,7 @@ export var increaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-
|
|
|
96
96
|
export var decreaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-Alt-[');
|
|
97
97
|
export var activateVideoControls = makeKeyMapWithCommon('Activate controls panel on video', 'Shift-F10');
|
|
98
98
|
export var toggleHighlightPalette = makeKeyMapWithCommon('Toggle Highlight Palette', 'Mod-Alt-b');
|
|
99
|
+
export var focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table context menu trigger', 'Shift-F10');
|
|
99
100
|
var arrowKeysMap = {
|
|
100
101
|
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
101
102
|
ARROWLEFT: "\u2190",
|
|
@@ -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 = "83.0.
|
|
10
|
+
var packageVersion = "83.0.3";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
17
17
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
18
18
|
import Layer from '../Layer';
|
|
19
19
|
var packageName = "@atlaskit/editor-common";
|
|
20
|
-
var packageVersion = "83.0.
|
|
20
|
+
var packageVersion = "83.0.3";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -17,13 +17,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
17
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
18
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
19
19
|
/** @jsx jsx */
|
|
20
|
-
|
|
21
20
|
import React, { PureComponent, useContext } from 'react';
|
|
22
|
-
|
|
23
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
24
22
|
import { css, jsx } from '@emotion/react';
|
|
25
23
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
26
24
|
import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
25
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
27
26
|
import { B100, N70, N900 } from '@atlaskit/theme/colors';
|
|
28
27
|
import Tooltip from '@atlaskit/tooltip';
|
|
29
28
|
import { DropdownMenuSharedCssClassName } from '../../styles';
|
|
@@ -53,7 +52,7 @@ var buttonStyles = function buttonStyles(isActive, submenuActive) {
|
|
|
53
52
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t\t> span,\n\t\t\t> span:hover,\n\t\t\t> span:active {\n\t\t\t\tbackground: ", ";\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t\t:focus > span[aria-disabled='false'] {\n\t\t\t\t", ";\n\t\t\t}\n\t\t\t:focus-visible,\n\t\t\t:focus-visible > span[aria-disabled='false'] {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t"])), "var(--ds-background-selected, #6c798f)", "var(--ds-text, #fff)", focusedMenuItemStyle);
|
|
54
53
|
} else {
|
|
55
54
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
56
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t\t> span:hover[aria-disabled='false'] {\n\t\t\t\tcolor: ", ";\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\t", "\n\t\t\t> span[aria-disabled='true'] {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t\t:focus > span[aria-disabled='false'] {\n\t\t\t\t", ";\n\t\t\t}\n\t\t\t:focus-visible,\n\t\t\t:focus-visible > span[aria-disabled='false'] {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t"])), "var(--ds-text, ".concat(N900, ")"), "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))", !submenuActive && "\n
|
|
55
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t\t> span:hover[aria-disabled='false'] {\n\t\t\t\tcolor: ", ";\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\t\t\t", "\n\t\t\t> span[aria-disabled='true'] {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t\t:focus > span[aria-disabled='false'] {\n\t\t\t\t", ";\n\t\t\t}\n\t\t\t:focus-visible,\n\t\t\t:focus-visible > span[aria-disabled='false'] {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t"])), "var(--ds-text, ".concat(N900, ")"), "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))", !submenuActive && "\n\t\t\t\t\t> span:active[aria-disabled='false'] {\n\t\t\t\t\t\tbackground-color: ".concat("var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))", ";\n\t\t\t\t\t}"), "var(--ds-text-disabled, ".concat(N70, ")"), focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
|
|
57
56
|
}
|
|
58
57
|
};
|
|
59
58
|
var DropListWithOutsideListeners = withReactEditorViewOuterListeners(DropList);
|
|
@@ -92,16 +91,28 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
93
|
});
|
|
95
|
-
_defineProperty(_assertThisInitialized(_this), "handleCloseAndFocus", function () {
|
|
94
|
+
_defineProperty(_assertThisInitialized(_this), "handleCloseAndFocus", function (event) {
|
|
96
95
|
var _this$state$target;
|
|
97
96
|
(_this$state$target = _this.state.target) === null || _this$state$target === void 0 || (_this$state$target = _this$state$target.querySelector('button')) === null || _this$state$target === void 0 || _this$state$target.focus();
|
|
98
|
-
|
|
97
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
98
|
+
_this.handleClose(event);
|
|
99
|
+
} else {
|
|
100
|
+
_this.handleClose();
|
|
101
|
+
}
|
|
99
102
|
});
|
|
100
|
-
_defineProperty(_assertThisInitialized(_this), "handleClose", function () {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
_defineProperty(_assertThisInitialized(_this), "handleClose", function (event) {
|
|
104
|
+
var onOpenChange = _this.props.onOpenChange;
|
|
105
|
+
if (onOpenChange) {
|
|
106
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
107
|
+
onOpenChange({
|
|
108
|
+
isOpen: false,
|
|
109
|
+
event: event
|
|
110
|
+
});
|
|
111
|
+
} else {
|
|
112
|
+
onOpenChange({
|
|
113
|
+
isOpen: false
|
|
114
|
+
});
|
|
115
|
+
}
|
|
105
116
|
}
|
|
106
117
|
});
|
|
107
118
|
return _this;
|
|
@@ -126,8 +137,8 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
126
137
|
shouldUseDefaultRole = _this$props.shouldUseDefaultRole,
|
|
127
138
|
onItemActivated = _this$props.onItemActivated,
|
|
128
139
|
arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions,
|
|
129
|
-
section = _this$props.section
|
|
130
|
-
|
|
140
|
+
section = _this$props.section,
|
|
141
|
+
isAllowEnterDefaultBehavior = _this$props.isAllowEnterDefaultBehavior;
|
|
131
142
|
// Note that this onSelection function can't be refactored to useMemo for
|
|
132
143
|
// performance gains as it is being used as a dependency in a useEffect in
|
|
133
144
|
// MenuArrowKeyNavigationProvider in order to check for re-renders to adjust
|
|
@@ -170,7 +181,13 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
170
181
|
handleClickOutside: this.handleClose,
|
|
171
182
|
handleEscapeKeydown: this.handleCloseAndFocus,
|
|
172
183
|
handleEnterKeydown: function handleEnterKeydown(e) {
|
|
173
|
-
|
|
184
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
185
|
+
if (!isAllowEnterDefaultBehavior) {
|
|
186
|
+
e.preventDefault();
|
|
187
|
+
}
|
|
188
|
+
} else {
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
}
|
|
174
191
|
e.stopPropagation();
|
|
175
192
|
},
|
|
176
193
|
targetRef: this.state.target
|
|
@@ -308,7 +325,8 @@ export function DropdownMenuItem(_ref) {
|
|
|
308
325
|
return _onMouseLeave && _onMouseLeave({
|
|
309
326
|
item: item
|
|
310
327
|
});
|
|
311
|
-
}
|
|
328
|
+
},
|
|
329
|
+
"aria-expanded": getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? item['aria-expanded'] : undefined
|
|
312
330
|
}, item.content));
|
|
313
331
|
if (item.tooltipDescription) {
|
|
314
332
|
var _item$key3;
|
|
@@ -90,6 +90,7 @@ export declare const increaseMediaSize: Keymap;
|
|
|
90
90
|
export declare const decreaseMediaSize: Keymap;
|
|
91
91
|
export declare const activateVideoControls: Keymap;
|
|
92
92
|
export declare const toggleHighlightPalette: Keymap;
|
|
93
|
+
export declare const focusToContextMenuTrigger: Keymap;
|
|
93
94
|
export declare function tooltip(keymap?: Keymap, description?: string): string | undefined;
|
|
94
95
|
export declare const ToolTipContent: React.MemoExoticComponent<({ description, shortcutOverride, keymap, }: {
|
|
95
96
|
description?: string | React.ReactNode;
|
|
@@ -30,6 +30,7 @@ export interface Props {
|
|
|
30
30
|
arrowKeyNavigationProviderOptions: ArrowKeyNavigationProviderOptions;
|
|
31
31
|
section?: SectionOptions;
|
|
32
32
|
children?: React.ReactNode;
|
|
33
|
+
isAllowEnterDefaultBehavior?: boolean;
|
|
33
34
|
}
|
|
34
35
|
export interface MenuItem {
|
|
35
36
|
key?: string;
|
|
@@ -50,6 +51,7 @@ export interface MenuItem {
|
|
|
50
51
|
'aria-haspopup'?: React.AriaAttributes['aria-haspopup'];
|
|
51
52
|
'aria-keyshortcuts'?: React.AriaAttributes['aria-keyshortcuts'];
|
|
52
53
|
onClick?: (editorActions: EditorActions) => void;
|
|
54
|
+
'aria-expanded'?: React.AriaAttributes['aria-expanded'];
|
|
53
55
|
}
|
|
54
56
|
export interface State {
|
|
55
57
|
target?: HTMLElement;
|
|
@@ -90,6 +90,7 @@ export declare const increaseMediaSize: Keymap;
|
|
|
90
90
|
export declare const decreaseMediaSize: Keymap;
|
|
91
91
|
export declare const activateVideoControls: Keymap;
|
|
92
92
|
export declare const toggleHighlightPalette: Keymap;
|
|
93
|
+
export declare const focusToContextMenuTrigger: Keymap;
|
|
93
94
|
export declare function tooltip(keymap?: Keymap, description?: string): string | undefined;
|
|
94
95
|
export declare const ToolTipContent: React.MemoExoticComponent<({ description, shortcutOverride, keymap, }: {
|
|
95
96
|
description?: string | React.ReactNode;
|
|
@@ -30,6 +30,7 @@ export interface Props {
|
|
|
30
30
|
arrowKeyNavigationProviderOptions: ArrowKeyNavigationProviderOptions;
|
|
31
31
|
section?: SectionOptions;
|
|
32
32
|
children?: React.ReactNode;
|
|
33
|
+
isAllowEnterDefaultBehavior?: boolean;
|
|
33
34
|
}
|
|
34
35
|
export interface MenuItem {
|
|
35
36
|
key?: string;
|
|
@@ -50,6 +51,7 @@ export interface MenuItem {
|
|
|
50
51
|
'aria-haspopup'?: React.AriaAttributes['aria-haspopup'];
|
|
51
52
|
'aria-keyshortcuts'?: React.AriaAttributes['aria-keyshortcuts'];
|
|
52
53
|
onClick?: (editorActions: EditorActions) => void;
|
|
54
|
+
'aria-expanded'?: React.AriaAttributes['aria-expanded'];
|
|
53
55
|
}
|
|
54
56
|
export interface State {
|
|
55
57
|
target?: HTMLElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "83.0.
|
|
3
|
+
"version": "83.0.3",
|
|
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/"
|
|
@@ -262,6 +262,9 @@
|
|
|
262
262
|
},
|
|
263
263
|
"platform.editor.text-alignment-keyboard-shortcuts": {
|
|
264
264
|
"type": "boolean"
|
|
265
|
+
},
|
|
266
|
+
"platform.editor.a11y-table-context-menu_y4c9c": {
|
|
267
|
+
"type": "boolean"
|
|
265
268
|
}
|
|
266
269
|
}
|
|
267
270
|
}
|