@atlaskit/editor-common 85.0.0 → 85.2.0
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 +24 -0
- package/dist/cjs/keymaps/index.js +3 -2
- package/dist/cjs/link/ConfigureLinkOverlay/Dropdown.js +6 -3
- package/dist/cjs/link/ConfigureLinkOverlay/index.js +1 -0
- package/dist/cjs/link/ConfigureLinkOverlay/useLinkOverlayAnalyticsEvents.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/Color/index.js +11 -0
- package/dist/cjs/ui-color/ColorPalette/index.js +2 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +18 -5
- package/dist/cjs/ui-menu/DropdownMenu/index.js +33 -11
- package/dist/es2019/keymaps/index.js +1 -0
- package/dist/es2019/link/ConfigureLinkOverlay/Dropdown.js +5 -2
- package/dist/es2019/link/ConfigureLinkOverlay/index.js +1 -0
- package/dist/es2019/link/ConfigureLinkOverlay/useLinkOverlayAnalyticsEvents.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Color/index.js +13 -0
- package/dist/es2019/ui-color/ColorPalette/index.js +2 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +19 -6
- package/dist/es2019/ui-menu/DropdownMenu/index.js +34 -12
- package/dist/esm/keymaps/index.js +1 -0
- package/dist/esm/link/ConfigureLinkOverlay/Dropdown.js +6 -3
- package/dist/esm/link/ConfigureLinkOverlay/index.js +1 -0
- package/dist/esm/link/ConfigureLinkOverlay/useLinkOverlayAnalyticsEvents.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Color/index.js +11 -0
- package/dist/esm/ui-color/ColorPalette/index.js +2 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +19 -6
- package/dist/esm/ui-menu/DropdownMenu/index.js +34 -12
- package/dist/types/keymaps/index.d.ts +1 -0
- package/dist/types/link/ConfigureLinkOverlay/Dropdown.d.ts +2 -0
- package/dist/types/ui-color/ColorPalette/Color/index.d.ts +2 -1
- package/dist/types/ui-color/ColorPalette/index.d.ts +1 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/types.d.ts +1 -0
- package/dist/types/ui-menu/DropdownMenu/types.d.ts +4 -1
- package/dist/types-ts4.5/keymaps/index.d.ts +1 -0
- package/dist/types-ts4.5/link/ConfigureLinkOverlay/Dropdown.d.ts +2 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Color/index.d.ts +2 -1
- package/dist/types-ts4.5/ui-color/ColorPalette/index.d.ts +1 -0
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/types.d.ts +1 -0
- package/dist/types-ts4.5/ui-menu/DropdownMenu/types.d.ts +4 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 85.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#119849](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119849)
|
|
8
|
+
[`8160c4683046e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8160c4683046e) -
|
|
9
|
+
EDM-10391 Configure button in smart link in live pages on narrow links now selects link
|
|
10
|
+
|
|
11
|
+
## 85.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#119419](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119419)
|
|
16
|
+
[`a8b716b766200`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a8b716b766200) -
|
|
17
|
+
[ux] Add keymap for showing drag handle on selected element"
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#120417](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120417)
|
|
22
|
+
[`26e76bb38b63f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/26e76bb38b63f) -
|
|
23
|
+
[ux] ECA11Y-175: This changes improves the floating toolbar a11y by making the image border
|
|
24
|
+
options menu accessible for keyboard-only users, and is behind the feature gate
|
|
25
|
+
`platform-editor-a11y-image-border-options-dropdown`.
|
|
26
|
+
|
|
3
27
|
## 85.0.0
|
|
4
28
|
|
|
5
29
|
### Major Changes
|
|
@@ -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 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = void 0;
|
|
103
|
+
exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.startColumnResizing = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.showElementDragHandle = 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 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = void 0;
|
|
105
105
|
exports.tooltip = tooltip;
|
|
106
106
|
exports.undo = void 0;
|
|
107
107
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -210,6 +210,7 @@ var toggleHighlightPalette = exports.toggleHighlightPalette = makeKeyMapWithComm
|
|
|
210
210
|
var focusToContextMenuTrigger = exports.focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table context menu trigger', 'Shift-F10');
|
|
211
211
|
var dragToMoveUp = exports.dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Alt-Shift-ArrowUp');
|
|
212
212
|
var dragToMoveDown = exports.dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Alt-Shift-ArrowDown');
|
|
213
|
+
var showElementDragHandle = exports.showElementDragHandle = makeKeyMapWithCommon('Show drag handle for editor element', 'Ctrl-Alt-Shift-a');
|
|
213
214
|
var arrowKeysMap = {
|
|
214
215
|
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
215
216
|
ARROWLEFT: "\u2190",
|
|
@@ -26,7 +26,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
26
26
|
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; }
|
|
27
27
|
var SMALL_LINK_TOOLBAR_ANALYTICS_SOURCE = 'smallLinkToolbar';
|
|
28
28
|
var Dropdown = function Dropdown(_ref) {
|
|
29
|
-
var
|
|
29
|
+
var onConfigureClickCallback = _ref.onConfigureClick,
|
|
30
|
+
onDropdownChange = _ref.onDropdownChange,
|
|
30
31
|
testId = _ref.testId;
|
|
31
32
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
32
33
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -48,7 +49,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
48
49
|
}, [fireActionClickEvent]);
|
|
49
50
|
var onConfigureClick = (0, _react.useCallback)(function () {
|
|
50
51
|
fireActionClickEvent('configureLink');
|
|
51
|
-
|
|
52
|
+
onConfigureClickCallback === null || onConfigureClickCallback === void 0 || onConfigureClickCallback();
|
|
53
|
+
}, [fireActionClickEvent, onConfigureClickCallback]);
|
|
52
54
|
return (0, _react2.jsx)(_dropdownMenu.default, {
|
|
53
55
|
trigger: function trigger(_ref3) {
|
|
54
56
|
var _onClick = _ref3.onClick,
|
|
@@ -80,7 +82,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
80
82
|
label: configureLinkLabel,
|
|
81
83
|
size: 'medium'
|
|
82
84
|
}),
|
|
83
|
-
onClick: onConfigureClick
|
|
85
|
+
onClick: onConfigureClick,
|
|
86
|
+
testId: "".concat(testId, "-dropdown-item-configure")
|
|
84
87
|
}, configureLinkLabel)));
|
|
85
88
|
};
|
|
86
89
|
var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
|
|
@@ -94,6 +94,7 @@ var OverlayButton = exports.OverlayButton = (0, _analyticsNext.withAnalyticsCont
|
|
|
94
94
|
"data-testid": testId
|
|
95
95
|
}, showDropdown ? (0, _react2.jsx)(_Dropdown.default, {
|
|
96
96
|
testId: testId,
|
|
97
|
+
onConfigureClick: handleConfigureClick,
|
|
97
98
|
onDropdownChange: onDropdownChange
|
|
98
99
|
}) : (0, _react2.jsx)(_tooltip.default, {
|
|
99
100
|
content: configureLinkLabel,
|
|
@@ -35,7 +35,7 @@ var useLinkOverlayAnalyticsEvents = exports.useLinkOverlayAnalyticsEvents = func
|
|
|
35
35
|
action: _analytics.ACTION.VIEWED,
|
|
36
36
|
actionSubject: _analytics.ACTION_SUBJECT.INLINE_DIALOG,
|
|
37
37
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.SMART_LINK_TOOLBAR,
|
|
38
|
-
eventType: _analytics.EVENT_TYPE.
|
|
38
|
+
eventType: _analytics.EVENT_TYPE.UI,
|
|
39
39
|
attributes: {
|
|
40
40
|
linkType: 'smallLink'
|
|
41
41
|
}
|
|
@@ -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 = "85.
|
|
20
|
+
var packageVersion = "85.2.0";
|
|
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 = "85.
|
|
23
|
+
var packageVersion = "85.2.0";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -37,6 +37,16 @@ var Color = function Color(props) {
|
|
|
37
37
|
e.preventDefault();
|
|
38
38
|
onClick(value, label);
|
|
39
39
|
};
|
|
40
|
+
var onKeyDown = function onKeyDown(e) {
|
|
41
|
+
var onKeyDown = props.onKeyDown,
|
|
42
|
+
value = props.value,
|
|
43
|
+
label = props.label;
|
|
44
|
+
if (!onKeyDown) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
onKeyDown(value, label, e);
|
|
49
|
+
};
|
|
40
50
|
return (0, _react2.jsx)(_tooltip.default, {
|
|
41
51
|
content: label
|
|
42
52
|
}, (0, _react2.jsx)("span", {
|
|
@@ -50,6 +60,7 @@ var Color = function Color(props) {
|
|
|
50
60
|
role: "radio",
|
|
51
61
|
"aria-checked": isSelected,
|
|
52
62
|
onClick: onClick,
|
|
63
|
+
onKeyDown: onKeyDown,
|
|
53
64
|
onMouseDown: onMouseDown,
|
|
54
65
|
tabIndex: tabIndex
|
|
55
66
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -49,6 +49,7 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
49
49
|
var _props$cols = props.cols,
|
|
50
50
|
cols = _props$cols === void 0 ? _utils.DEFAULT_COLOR_PICKER_COLUMNS : _props$cols,
|
|
51
51
|
onClick = props.onClick,
|
|
52
|
+
onKeyDown = props.onKeyDown,
|
|
52
53
|
selectedColor = props.selectedColor,
|
|
53
54
|
className = props.className,
|
|
54
55
|
formatMessage = props.intl.formatMessage,
|
|
@@ -91,6 +92,7 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
91
92
|
borderColor: border,
|
|
92
93
|
label: message ? formatMessage(message) : label,
|
|
93
94
|
onClick: onClick,
|
|
95
|
+
onKeyDown: onKeyDown,
|
|
94
96
|
isSelected: value === selectedColor,
|
|
95
97
|
checkMarkColor: getCheckMarkColor(value, useIconToken),
|
|
96
98
|
hexToPaletteColor: hexToPaletteColor,
|
|
@@ -29,13 +29,14 @@ var MenuArrowKeyNavigationProvider = exports.MenuArrowKeyNavigationProvider = fu
|
|
|
29
29
|
closeOnTab = _ref.closeOnTab,
|
|
30
30
|
onSelection = _ref.onSelection,
|
|
31
31
|
editorRef = _ref.editorRef,
|
|
32
|
-
popupsMountPoint = _ref.popupsMountPoint
|
|
32
|
+
popupsMountPoint = _ref.popupsMountPoint,
|
|
33
|
+
disableCloseOnArrowClick = _ref.disableCloseOnArrowClick;
|
|
33
34
|
var wrapperRef = (0, _react.useRef)(null);
|
|
34
35
|
var _useState = (0, _react.useState)(-1),
|
|
35
36
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
36
37
|
currentSelectedItemIndex = _useState2[0],
|
|
37
38
|
setCurrentSelectedItemIndex = _useState2[1];
|
|
38
|
-
var element = (0, _platformFeatureFlags.
|
|
39
|
+
var element = popupsMountPoint && (0, _platformFeatureFlags.fg)('platform.editor.a11y-main-toolbar-navigation_osrty') ? [popupsMountPoint, editorRef.current] : [editorRef.current];
|
|
39
40
|
var _useState3 = (0, _react.useState)(element),
|
|
40
41
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 1),
|
|
41
42
|
listenerTargetElement = _useState4[0];
|
|
@@ -130,7 +131,13 @@ var MenuArrowKeyNavigationProvider = exports.MenuArrowKeyNavigationProvider = fu
|
|
|
130
131
|
if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
133
|
-
|
|
134
|
+
if ((0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
|
|
135
|
+
if (!disableCloseOnArrowClick) {
|
|
136
|
+
handleClose(event);
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
handleClose(event);
|
|
140
|
+
}
|
|
134
141
|
if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
135
142
|
keyDownHandlerContext === null || keyDownHandlerContext === void 0 || keyDownHandlerContext.handleArrowLeft();
|
|
136
143
|
}
|
|
@@ -139,7 +146,13 @@ var MenuArrowKeyNavigationProvider = exports.MenuArrowKeyNavigationProvider = fu
|
|
|
139
146
|
if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
|
|
140
147
|
return;
|
|
141
148
|
}
|
|
142
|
-
|
|
149
|
+
if ((0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
|
|
150
|
+
if (!disableCloseOnArrowClick) {
|
|
151
|
+
handleClose(event);
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
handleClose(event);
|
|
155
|
+
}
|
|
143
156
|
if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
144
157
|
keyDownHandlerContext === null || keyDownHandlerContext === void 0 || keyDownHandlerContext.handleArrowRight();
|
|
145
158
|
}
|
|
@@ -164,7 +177,7 @@ var MenuArrowKeyNavigationProvider = exports.MenuArrowKeyNavigationProvider = fu
|
|
|
164
177
|
elem && elem.removeEventListener('keydown', handleKeyDown);
|
|
165
178
|
});
|
|
166
179
|
};
|
|
167
|
-
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, incrementIndex, decrementIndex, listenerTargetElement]);
|
|
180
|
+
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, incrementIndex, decrementIndex, listenerTargetElement, disableCloseOnArrowClick]);
|
|
168
181
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
169
182
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
170
183
|
className: "menu-key-handler-wrapper custom-key-handler-wrapper",
|
|
@@ -105,7 +105,7 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
|
|
|
105
105
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleCloseAndFocus", function (event) {
|
|
106
106
|
var _this$state$target;
|
|
107
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();
|
|
108
|
-
if ((0, _platformFeatureFlags.
|
|
108
|
+
if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
109
109
|
_this.handleClose(event);
|
|
110
110
|
} else {
|
|
111
111
|
_this.handleClose();
|
|
@@ -114,7 +114,7 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
|
|
|
114
114
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClose", function (event) {
|
|
115
115
|
var onOpenChange = _this.props.onOpenChange;
|
|
116
116
|
if (onOpenChange) {
|
|
117
|
-
if ((0, _platformFeatureFlags.
|
|
117
|
+
if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
118
118
|
onOpenChange({
|
|
119
119
|
isOpen: false,
|
|
120
120
|
event: event
|
|
@@ -149,7 +149,8 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
|
|
|
149
149
|
onItemActivated = _this$props.onItemActivated,
|
|
150
150
|
arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions,
|
|
151
151
|
section = _this$props.section,
|
|
152
|
-
|
|
152
|
+
allowEnterDefaultBehavior = _this$props.allowEnterDefaultBehavior,
|
|
153
|
+
handleEscapeKeydown = _this$props.handleEscapeKeydown;
|
|
153
154
|
// Note that this onSelection function can't be refactored to useMemo for
|
|
154
155
|
// performance gains as it is being used as a dependency in a useEffect in
|
|
155
156
|
// MenuArrowKeyNavigationProvider in order to check for re-renders to adjust
|
|
@@ -190,10 +191,10 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
|
|
|
190
191
|
shouldFitContainer: true,
|
|
191
192
|
isTriggerNotTabbable: true,
|
|
192
193
|
handleClickOutside: this.handleClose,
|
|
193
|
-
handleEscapeKeydown: this.handleCloseAndFocus,
|
|
194
|
+
handleEscapeKeydown: (0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown') ? handleEscapeKeydown || this.handleCloseAndFocus : this.handleCloseAndFocus,
|
|
194
195
|
handleEnterKeydown: function handleEnterKeydown(e) {
|
|
195
|
-
if ((0, _platformFeatureFlags.
|
|
196
|
-
if (!
|
|
196
|
+
if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c') || (0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
|
|
197
|
+
if (!allowEnterDefaultBehavior) {
|
|
197
198
|
e.preventDefault();
|
|
198
199
|
}
|
|
199
200
|
} else {
|
|
@@ -255,7 +256,7 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
|
|
|
255
256
|
key: 'ArrowDown',
|
|
256
257
|
bubbles: true
|
|
257
258
|
});
|
|
258
|
-
if (mountTo && (0, _platformFeatureFlags.
|
|
259
|
+
if (mountTo && (0, _platformFeatureFlags.fg)('platform.editor.a11y-main-toolbar-navigation_osrty')) {
|
|
259
260
|
mountTo.dispatchEvent(keyboardEvent);
|
|
260
261
|
return;
|
|
261
262
|
}
|
|
@@ -306,17 +307,38 @@ function DropdownMenuItem(_ref) {
|
|
|
306
307
|
var _handleSubmenuActive = function _handleSubmenuActive(event) {
|
|
307
308
|
setSubmenuActive(Boolean(event.target instanceof HTMLElement && event.target.closest(".".concat(_styles.DropdownMenuSharedCssClassName.SUBMENU))));
|
|
308
309
|
};
|
|
310
|
+
var ariaLabel;
|
|
311
|
+
if ((0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
|
|
312
|
+
ariaLabel = item['aria-label'] === '' ? undefined : item['aria-label'] || String(item.content);
|
|
313
|
+
} else {
|
|
314
|
+
ariaLabel = item['aria-label'] || String(item.content);
|
|
315
|
+
}
|
|
316
|
+
var testId;
|
|
317
|
+
if ((0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
|
|
318
|
+
testId = item['data-testid'] || "dropdown-item__".concat(item.content);
|
|
319
|
+
} else {
|
|
320
|
+
testId = "dropdown-item__".concat(String(item.content));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// From time to time we don't want to have any tabIndex on item wrapper
|
|
324
|
+
// especially when we pass any interactive element as a item.content
|
|
325
|
+
var tabIndex;
|
|
326
|
+
if ((0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
|
|
327
|
+
tabIndex = item.wrapperTabIndex === null ? undefined : item.wrapperTabIndex || -1;
|
|
328
|
+
} else {
|
|
329
|
+
tabIndex = -1;
|
|
330
|
+
}
|
|
309
331
|
var dropListItem = (0, _react2.jsx)("div", {
|
|
310
332
|
css: function css() {
|
|
311
333
|
return buttonStyles(item.isActive, submenuActive);
|
|
312
334
|
},
|
|
313
|
-
tabIndex:
|
|
335
|
+
tabIndex: tabIndex,
|
|
314
336
|
"aria-disabled": item.isDisabled ? 'true' : 'false',
|
|
315
337
|
onMouseDown: _handleSubmenuActive
|
|
316
338
|
}, (0, _react2.jsx)(_menu.CustomItem, {
|
|
317
339
|
item: item,
|
|
318
340
|
key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
|
|
319
|
-
testId:
|
|
341
|
+
testId: testId,
|
|
320
342
|
role: shouldUseDefaultRole ? 'button' : 'menuitem',
|
|
321
343
|
iconBefore: item.elemBefore,
|
|
322
344
|
iconAfter: item.elemAfter,
|
|
@@ -326,7 +348,7 @@ function DropdownMenuItem(_ref) {
|
|
|
326
348
|
item: item
|
|
327
349
|
});
|
|
328
350
|
},
|
|
329
|
-
"aria-label":
|
|
351
|
+
"aria-label": ariaLabel,
|
|
330
352
|
"aria-pressed": shouldUseDefaultRole ? item.isActive : undefined,
|
|
331
353
|
"aria-keyshortcuts": item['aria-keyshortcuts'],
|
|
332
354
|
onMouseDown: function onMouseDown(e) {
|
|
@@ -343,7 +365,7 @@ function DropdownMenuItem(_ref) {
|
|
|
343
365
|
item: item
|
|
344
366
|
});
|
|
345
367
|
},
|
|
346
|
-
"aria-expanded": (0, _platformFeatureFlags.
|
|
368
|
+
"aria-expanded": (0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c') ? item['aria-expanded'] : undefined
|
|
347
369
|
}, item.content));
|
|
348
370
|
if (item.tooltipDescription) {
|
|
349
371
|
var _item$key3;
|
|
@@ -98,6 +98,7 @@ export const toggleHighlightPalette = makeKeyMapWithCommon('Toggle Highlight Pal
|
|
|
98
98
|
export const focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table context menu trigger', 'Shift-F10');
|
|
99
99
|
export const dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Alt-Shift-ArrowUp');
|
|
100
100
|
export const dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Alt-Shift-ArrowDown');
|
|
101
|
+
export const showElementDragHandle = makeKeyMapWithCommon('Show drag handle for editor element', 'Ctrl-Alt-Shift-a');
|
|
101
102
|
const arrowKeysMap = {
|
|
102
103
|
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
103
104
|
ARROWLEFT: '\u2190',
|
|
@@ -15,6 +15,7 @@ import { StyledButton } from './StyledButton';
|
|
|
15
15
|
import { useLinkOverlayAnalyticsEvents } from './useLinkOverlayAnalyticsEvents';
|
|
16
16
|
const SMALL_LINK_TOOLBAR_ANALYTICS_SOURCE = 'smallLinkToolbar';
|
|
17
17
|
const Dropdown = ({
|
|
18
|
+
onConfigureClick: onConfigureClickCallback,
|
|
18
19
|
onDropdownChange,
|
|
19
20
|
testId
|
|
20
21
|
}) => {
|
|
@@ -41,7 +42,8 @@ const Dropdown = ({
|
|
|
41
42
|
}, [fireActionClickEvent]);
|
|
42
43
|
const onConfigureClick = useCallback(() => {
|
|
43
44
|
fireActionClickEvent('configureLink');
|
|
44
|
-
|
|
45
|
+
onConfigureClickCallback === null || onConfigureClickCallback === void 0 ? void 0 : onConfigureClickCallback();
|
|
46
|
+
}, [fireActionClickEvent, onConfigureClickCallback]);
|
|
45
47
|
return jsx(DropdownMenu, {
|
|
46
48
|
trigger: ({
|
|
47
49
|
onClick,
|
|
@@ -72,7 +74,8 @@ const Dropdown = ({
|
|
|
72
74
|
label: configureLinkLabel,
|
|
73
75
|
size: 'medium'
|
|
74
76
|
}),
|
|
75
|
-
onClick: onConfigureClick
|
|
77
|
+
onClick: onConfigureClick,
|
|
78
|
+
testId: `${testId}-dropdown-item-configure`
|
|
76
79
|
}, configureLinkLabel)));
|
|
77
80
|
};
|
|
78
81
|
export default withAnalyticsContext({
|
|
@@ -85,6 +85,7 @@ export const OverlayButton = withAnalyticsContext()(({
|
|
|
85
85
|
"data-testid": testId
|
|
86
86
|
}, showDropdown ? jsx(Dropdown, {
|
|
87
87
|
testId: testId,
|
|
88
|
+
onConfigureClick: handleConfigureClick,
|
|
88
89
|
onDropdownChange: onDropdownChange
|
|
89
90
|
}) : jsx(Tooltip, {
|
|
90
91
|
content: configureLinkLabel,
|
|
@@ -29,7 +29,7 @@ export const useLinkOverlayAnalyticsEvents = () => {
|
|
|
29
29
|
action: ACTION.VIEWED,
|
|
30
30
|
actionSubject: ACTION_SUBJECT.INLINE_DIALOG,
|
|
31
31
|
actionSubjectId: ACTION_SUBJECT_ID.SMART_LINK_TOOLBAR,
|
|
32
|
-
eventType: EVENT_TYPE.
|
|
32
|
+
eventType: EVENT_TYPE.UI,
|
|
33
33
|
attributes: {
|
|
34
34
|
linkType: 'smallLink'
|
|
35
35
|
}
|
|
@@ -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 = "85.
|
|
4
|
+
const packageVersion = "85.2.0";
|
|
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 = "85.
|
|
12
|
+
const packageVersion = "85.2.0";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -39,6 +39,18 @@ const Color = props => {
|
|
|
39
39
|
e.preventDefault();
|
|
40
40
|
onClick(value, label);
|
|
41
41
|
};
|
|
42
|
+
const onKeyDown = e => {
|
|
43
|
+
const {
|
|
44
|
+
onKeyDown,
|
|
45
|
+
value,
|
|
46
|
+
label
|
|
47
|
+
} = props;
|
|
48
|
+
if (!onKeyDown) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
onKeyDown(value, label, e);
|
|
53
|
+
};
|
|
42
54
|
return jsx(Tooltip, {
|
|
43
55
|
content: label
|
|
44
56
|
}, jsx("span", {
|
|
@@ -52,6 +64,7 @@ const Color = props => {
|
|
|
52
64
|
role: "radio",
|
|
53
65
|
"aria-checked": isSelected,
|
|
54
66
|
onClick: onClick,
|
|
67
|
+
onKeyDown: onKeyDown,
|
|
55
68
|
onMouseDown: onMouseDown,
|
|
56
69
|
tabIndex: tabIndex
|
|
57
70
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -39,6 +39,7 @@ const ColorPalette = props => {
|
|
|
39
39
|
const {
|
|
40
40
|
cols = DEFAULT_COLOR_PICKER_COLUMNS,
|
|
41
41
|
onClick,
|
|
42
|
+
onKeyDown,
|
|
42
43
|
selectedColor,
|
|
43
44
|
className,
|
|
44
45
|
intl: {
|
|
@@ -87,6 +88,7 @@ const ColorPalette = props => {
|
|
|
87
88
|
borderColor: border,
|
|
88
89
|
label: message ? formatMessage(message) : label,
|
|
89
90
|
onClick: onClick,
|
|
91
|
+
onKeyDown: onKeyDown,
|
|
90
92
|
isSelected: value === selectedColor,
|
|
91
93
|
checkMarkColor: getCheckMarkColor(value, useIconToken),
|
|
92
94
|
hexToPaletteColor: hexToPaletteColor,
|
package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
const hasEnabledItems = list => list.some(item => item.getAttribute('aria-disabled') !== 'true');
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -14,11 +14,12 @@ export const MenuArrowKeyNavigationProvider = ({
|
|
|
14
14
|
closeOnTab,
|
|
15
15
|
onSelection,
|
|
16
16
|
editorRef,
|
|
17
|
-
popupsMountPoint
|
|
17
|
+
popupsMountPoint,
|
|
18
|
+
disableCloseOnArrowClick
|
|
18
19
|
}) => {
|
|
19
20
|
const wrapperRef = useRef(null);
|
|
20
21
|
const [currentSelectedItemIndex, setCurrentSelectedItemIndex] = useState(-1);
|
|
21
|
-
const element =
|
|
22
|
+
const element = popupsMountPoint && fg('platform.editor.a11y-main-toolbar-navigation_osrty') ? [popupsMountPoint, editorRef.current] : [editorRef.current];
|
|
22
23
|
const [listenerTargetElement] = useState(element);
|
|
23
24
|
const incrementIndex = useCallback(list => {
|
|
24
25
|
const currentIndex = currentSelectedItemIndex;
|
|
@@ -111,7 +112,13 @@ export const MenuArrowKeyNavigationProvider = ({
|
|
|
111
112
|
if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
|
-
|
|
115
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
116
|
+
if (!disableCloseOnArrowClick) {
|
|
117
|
+
handleClose(event);
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
handleClose(event);
|
|
121
|
+
}
|
|
115
122
|
if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
116
123
|
keyDownHandlerContext === null || keyDownHandlerContext === void 0 ? void 0 : keyDownHandlerContext.handleArrowLeft();
|
|
117
124
|
}
|
|
@@ -120,7 +127,13 @@ export const MenuArrowKeyNavigationProvider = ({
|
|
|
120
127
|
if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
|
|
121
128
|
return;
|
|
122
129
|
}
|
|
123
|
-
|
|
130
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
131
|
+
if (!disableCloseOnArrowClick) {
|
|
132
|
+
handleClose(event);
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
handleClose(event);
|
|
136
|
+
}
|
|
124
137
|
if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
125
138
|
keyDownHandlerContext === null || keyDownHandlerContext === void 0 ? void 0 : keyDownHandlerContext.handleArrowRight();
|
|
126
139
|
}
|
|
@@ -145,7 +158,7 @@ export const MenuArrowKeyNavigationProvider = ({
|
|
|
145
158
|
elem && elem.removeEventListener('keydown', handleKeyDown);
|
|
146
159
|
});
|
|
147
160
|
};
|
|
148
|
-
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, incrementIndex, decrementIndex, listenerTargetElement]);
|
|
161
|
+
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, incrementIndex, decrementIndex, listenerTargetElement, disableCloseOnArrowClick]);
|
|
149
162
|
return /*#__PURE__*/React.createElement("div", {
|
|
150
163
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
151
164
|
className: "menu-key-handler-wrapper custom-key-handler-wrapper",
|
|
@@ -6,7 +6,7 @@ import React, { PureComponent, useContext } from 'react';
|
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
9
|
-
import {
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { B100, N70, N900 } from '@atlaskit/theme/colors';
|
|
11
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
12
12
|
import { DropdownMenuSharedCssClassName } from '../../styles';
|
|
@@ -106,7 +106,7 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
106
106
|
_defineProperty(this, "handleCloseAndFocus", event => {
|
|
107
107
|
var _this$state$target, _this$state$target$qu;
|
|
108
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();
|
|
109
|
-
if (
|
|
109
|
+
if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
110
110
|
this.handleClose(event);
|
|
111
111
|
} else {
|
|
112
112
|
this.handleClose();
|
|
@@ -117,7 +117,7 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
117
117
|
onOpenChange
|
|
118
118
|
} = this.props;
|
|
119
119
|
if (onOpenChange) {
|
|
120
|
-
if (
|
|
120
|
+
if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
121
121
|
onOpenChange({
|
|
122
122
|
isOpen: false,
|
|
123
123
|
event: event
|
|
@@ -149,7 +149,8 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
149
149
|
onItemActivated,
|
|
150
150
|
arrowKeyNavigationProviderOptions,
|
|
151
151
|
section,
|
|
152
|
-
|
|
152
|
+
allowEnterDefaultBehavior,
|
|
153
|
+
handleEscapeKeydown
|
|
153
154
|
} = this.props;
|
|
154
155
|
// Note that this onSelection function can't be refactored to useMemo for
|
|
155
156
|
// performance gains as it is being used as a dependency in a useEffect in
|
|
@@ -192,10 +193,10 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
192
193
|
shouldFitContainer: true,
|
|
193
194
|
isTriggerNotTabbable: true,
|
|
194
195
|
handleClickOutside: this.handleClose,
|
|
195
|
-
handleEscapeKeydown: this.handleCloseAndFocus,
|
|
196
|
+
handleEscapeKeydown: fg('platform-editor-a11y-image-border-options-dropdown') ? handleEscapeKeydown || this.handleCloseAndFocus : this.handleCloseAndFocus,
|
|
196
197
|
handleEnterKeydown: e => {
|
|
197
|
-
if (
|
|
198
|
-
if (!
|
|
198
|
+
if (fg('platform.editor.a11y-table-context-menu_y4c9c') || fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
199
|
+
if (!allowEnterDefaultBehavior) {
|
|
199
200
|
e.preventDefault();
|
|
200
201
|
}
|
|
201
202
|
} else {
|
|
@@ -253,7 +254,7 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
253
254
|
key: 'ArrowDown',
|
|
254
255
|
bubbles: true
|
|
255
256
|
});
|
|
256
|
-
if (mountTo &&
|
|
257
|
+
if (mountTo && fg('platform.editor.a11y-main-toolbar-navigation_osrty')) {
|
|
257
258
|
mountTo.dispatchEvent(keyboardEvent);
|
|
258
259
|
return;
|
|
259
260
|
}
|
|
@@ -302,15 +303,36 @@ export function DropdownMenuItem({
|
|
|
302
303
|
const _handleSubmenuActive = event => {
|
|
303
304
|
setSubmenuActive(Boolean(event.target instanceof HTMLElement && event.target.closest(`.${DropdownMenuSharedCssClassName.SUBMENU}`)));
|
|
304
305
|
};
|
|
306
|
+
let ariaLabel;
|
|
307
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
308
|
+
ariaLabel = item['aria-label'] === '' ? undefined : item['aria-label'] || String(item.content);
|
|
309
|
+
} else {
|
|
310
|
+
ariaLabel = item['aria-label'] || String(item.content);
|
|
311
|
+
}
|
|
312
|
+
let testId;
|
|
313
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
314
|
+
testId = item['data-testid'] || `dropdown-item__${item.content}`;
|
|
315
|
+
} else {
|
|
316
|
+
testId = `dropdown-item__${String(item.content)}`;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// From time to time we don't want to have any tabIndex on item wrapper
|
|
320
|
+
// especially when we pass any interactive element as a item.content
|
|
321
|
+
let tabIndex;
|
|
322
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
323
|
+
tabIndex = item.wrapperTabIndex === null ? undefined : item.wrapperTabIndex || -1;
|
|
324
|
+
} else {
|
|
325
|
+
tabIndex = -1;
|
|
326
|
+
}
|
|
305
327
|
const dropListItem = jsx("div", {
|
|
306
328
|
css: () => buttonStyles(item.isActive, submenuActive),
|
|
307
|
-
tabIndex:
|
|
329
|
+
tabIndex: tabIndex,
|
|
308
330
|
"aria-disabled": item.isDisabled ? 'true' : 'false',
|
|
309
331
|
onMouseDown: _handleSubmenuActive
|
|
310
332
|
}, jsx(CustomItem, {
|
|
311
333
|
item: item,
|
|
312
334
|
key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
|
|
313
|
-
testId:
|
|
335
|
+
testId: testId,
|
|
314
336
|
role: shouldUseDefaultRole ? 'button' : 'menuitem',
|
|
315
337
|
iconBefore: item.elemBefore,
|
|
316
338
|
iconAfter: item.elemAfter,
|
|
@@ -318,7 +340,7 @@ export function DropdownMenuItem({
|
|
|
318
340
|
onClick: () => onItemActivated && onItemActivated({
|
|
319
341
|
item
|
|
320
342
|
}),
|
|
321
|
-
"aria-label":
|
|
343
|
+
"aria-label": ariaLabel,
|
|
322
344
|
"aria-pressed": shouldUseDefaultRole ? item.isActive : undefined,
|
|
323
345
|
"aria-keyshortcuts": item['aria-keyshortcuts'],
|
|
324
346
|
onMouseDown: e => {
|
|
@@ -331,7 +353,7 @@ export function DropdownMenuItem({
|
|
|
331
353
|
onMouseLeave: () => onMouseLeave && onMouseLeave({
|
|
332
354
|
item
|
|
333
355
|
}),
|
|
334
|
-
"aria-expanded":
|
|
356
|
+
"aria-expanded": fg('platform.editor.a11y-table-context-menu_y4c9c') ? item['aria-expanded'] : undefined
|
|
335
357
|
}, item.content));
|
|
336
358
|
if (item.tooltipDescription) {
|
|
337
359
|
var _item$key3;
|
|
@@ -99,6 +99,7 @@ export var toggleHighlightPalette = makeKeyMapWithCommon('Toggle Highlight Palet
|
|
|
99
99
|
export var focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table context menu trigger', 'Shift-F10');
|
|
100
100
|
export var dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Alt-Shift-ArrowUp');
|
|
101
101
|
export var dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Alt-Shift-ArrowDown');
|
|
102
|
+
export var showElementDragHandle = makeKeyMapWithCommon('Show drag handle for editor element', 'Ctrl-Alt-Shift-a');
|
|
102
103
|
var arrowKeysMap = {
|
|
103
104
|
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
104
105
|
ARROWLEFT: "\u2190",
|
|
@@ -17,7 +17,8 @@ import { StyledButton } from './StyledButton';
|
|
|
17
17
|
import { useLinkOverlayAnalyticsEvents } from './useLinkOverlayAnalyticsEvents';
|
|
18
18
|
var SMALL_LINK_TOOLBAR_ANALYTICS_SOURCE = 'smallLinkToolbar';
|
|
19
19
|
var Dropdown = function Dropdown(_ref) {
|
|
20
|
-
var
|
|
20
|
+
var onConfigureClickCallback = _ref.onConfigureClick,
|
|
21
|
+
onDropdownChange = _ref.onDropdownChange,
|
|
21
22
|
testId = _ref.testId;
|
|
22
23
|
var _useIntl = useIntl(),
|
|
23
24
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -39,7 +40,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
39
40
|
}, [fireActionClickEvent]);
|
|
40
41
|
var onConfigureClick = useCallback(function () {
|
|
41
42
|
fireActionClickEvent('configureLink');
|
|
42
|
-
|
|
43
|
+
onConfigureClickCallback === null || onConfigureClickCallback === void 0 || onConfigureClickCallback();
|
|
44
|
+
}, [fireActionClickEvent, onConfigureClickCallback]);
|
|
43
45
|
return jsx(DropdownMenu, {
|
|
44
46
|
trigger: function trigger(_ref3) {
|
|
45
47
|
var _onClick = _ref3.onClick,
|
|
@@ -71,7 +73,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
71
73
|
label: configureLinkLabel,
|
|
72
74
|
size: 'medium'
|
|
73
75
|
}),
|
|
74
|
-
onClick: onConfigureClick
|
|
76
|
+
onClick: onConfigureClick,
|
|
77
|
+
testId: "".concat(testId, "-dropdown-item-configure")
|
|
75
78
|
}, configureLinkLabel)));
|
|
76
79
|
};
|
|
77
80
|
export default withAnalyticsContext({
|
|
@@ -86,6 +86,7 @@ export var OverlayButton = withAnalyticsContext()(function (_ref) {
|
|
|
86
86
|
"data-testid": testId
|
|
87
87
|
}, showDropdown ? jsx(Dropdown, {
|
|
88
88
|
testId: testId,
|
|
89
|
+
onConfigureClick: handleConfigureClick,
|
|
89
90
|
onDropdownChange: onDropdownChange
|
|
90
91
|
}) : jsx(Tooltip, {
|
|
91
92
|
content: configureLinkLabel,
|
|
@@ -29,7 +29,7 @@ export var useLinkOverlayAnalyticsEvents = function useLinkOverlayAnalyticsEvent
|
|
|
29
29
|
action: ACTION.VIEWED,
|
|
30
30
|
actionSubject: ACTION_SUBJECT.INLINE_DIALOG,
|
|
31
31
|
actionSubjectId: ACTION_SUBJECT_ID.SMART_LINK_TOOLBAR,
|
|
32
|
-
eventType: EVENT_TYPE.
|
|
32
|
+
eventType: EVENT_TYPE.UI,
|
|
33
33
|
attributes: {
|
|
34
34
|
linkType: 'smallLink'
|
|
35
35
|
}
|
|
@@ -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 = "85.
|
|
10
|
+
var packageVersion = "85.2.0";
|
|
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 = "85.
|
|
20
|
+
var packageVersion = "85.2.0";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -29,6 +29,16 @@ var Color = function Color(props) {
|
|
|
29
29
|
e.preventDefault();
|
|
30
30
|
onClick(value, label);
|
|
31
31
|
};
|
|
32
|
+
var onKeyDown = function onKeyDown(e) {
|
|
33
|
+
var onKeyDown = props.onKeyDown,
|
|
34
|
+
value = props.value,
|
|
35
|
+
label = props.label;
|
|
36
|
+
if (!onKeyDown) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
onKeyDown(value, label, e);
|
|
41
|
+
};
|
|
32
42
|
return jsx(Tooltip, {
|
|
33
43
|
content: label
|
|
34
44
|
}, jsx("span", {
|
|
@@ -42,6 +52,7 @@ var Color = function Color(props) {
|
|
|
42
52
|
role: "radio",
|
|
43
53
|
"aria-checked": isSelected,
|
|
44
54
|
onClick: onClick,
|
|
55
|
+
onKeyDown: onKeyDown,
|
|
45
56
|
onMouseDown: onMouseDown,
|
|
46
57
|
tabIndex: tabIndex
|
|
47
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -41,6 +41,7 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
41
41
|
var _props$cols = props.cols,
|
|
42
42
|
cols = _props$cols === void 0 ? DEFAULT_COLOR_PICKER_COLUMNS : _props$cols,
|
|
43
43
|
onClick = props.onClick,
|
|
44
|
+
onKeyDown = props.onKeyDown,
|
|
44
45
|
selectedColor = props.selectedColor,
|
|
45
46
|
className = props.className,
|
|
46
47
|
formatMessage = props.intl.formatMessage,
|
|
@@ -83,6 +84,7 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
83
84
|
borderColor: border,
|
|
84
85
|
label: message ? formatMessage(message) : label,
|
|
85
86
|
onClick: onClick,
|
|
87
|
+
onKeyDown: onKeyDown,
|
|
86
88
|
isSelected: value === selectedColor,
|
|
87
89
|
checkMarkColor: getCheckMarkColor(value, useIconToken),
|
|
88
90
|
hexToPaletteColor: hexToPaletteColor,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
var hasEnabledItems = function hasEnabledItems(list) {
|
|
5
5
|
return list.some(function (item) {
|
|
6
6
|
return item.getAttribute('aria-disabled') !== 'true';
|
|
@@ -19,13 +19,14 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
|
|
|
19
19
|
closeOnTab = _ref.closeOnTab,
|
|
20
20
|
onSelection = _ref.onSelection,
|
|
21
21
|
editorRef = _ref.editorRef,
|
|
22
|
-
popupsMountPoint = _ref.popupsMountPoint
|
|
22
|
+
popupsMountPoint = _ref.popupsMountPoint,
|
|
23
|
+
disableCloseOnArrowClick = _ref.disableCloseOnArrowClick;
|
|
23
24
|
var wrapperRef = useRef(null);
|
|
24
25
|
var _useState = useState(-1),
|
|
25
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
27
|
currentSelectedItemIndex = _useState2[0],
|
|
27
28
|
setCurrentSelectedItemIndex = _useState2[1];
|
|
28
|
-
var element =
|
|
29
|
+
var element = popupsMountPoint && fg('platform.editor.a11y-main-toolbar-navigation_osrty') ? [popupsMountPoint, editorRef.current] : [editorRef.current];
|
|
29
30
|
var _useState3 = useState(element),
|
|
30
31
|
_useState4 = _slicedToArray(_useState3, 1),
|
|
31
32
|
listenerTargetElement = _useState4[0];
|
|
@@ -120,7 +121,13 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
|
|
|
120
121
|
if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
|
|
121
122
|
return;
|
|
122
123
|
}
|
|
123
|
-
|
|
124
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
125
|
+
if (!disableCloseOnArrowClick) {
|
|
126
|
+
handleClose(event);
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
handleClose(event);
|
|
130
|
+
}
|
|
124
131
|
if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
125
132
|
keyDownHandlerContext === null || keyDownHandlerContext === void 0 || keyDownHandlerContext.handleArrowLeft();
|
|
126
133
|
}
|
|
@@ -129,7 +136,13 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
|
|
|
129
136
|
if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
|
|
130
137
|
return;
|
|
131
138
|
}
|
|
132
|
-
|
|
139
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
140
|
+
if (!disableCloseOnArrowClick) {
|
|
141
|
+
handleClose(event);
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
handleClose(event);
|
|
145
|
+
}
|
|
133
146
|
if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
134
147
|
keyDownHandlerContext === null || keyDownHandlerContext === void 0 || keyDownHandlerContext.handleArrowRight();
|
|
135
148
|
}
|
|
@@ -154,7 +167,7 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
|
|
|
154
167
|
elem && elem.removeEventListener('keydown', handleKeyDown);
|
|
155
168
|
});
|
|
156
169
|
};
|
|
157
|
-
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, incrementIndex, decrementIndex, listenerTargetElement]);
|
|
170
|
+
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, incrementIndex, decrementIndex, listenerTargetElement, disableCloseOnArrowClick]);
|
|
158
171
|
return /*#__PURE__*/React.createElement("div", {
|
|
159
172
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
160
173
|
className: "menu-key-handler-wrapper custom-key-handler-wrapper",
|
|
@@ -22,7 +22,7 @@ import React, { PureComponent, useContext } from 'react';
|
|
|
22
22
|
import { css, jsx } from '@emotion/react';
|
|
23
23
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
24
24
|
import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
25
|
-
import {
|
|
25
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
26
26
|
import { B100, N70, N900 } from '@atlaskit/theme/colors';
|
|
27
27
|
import Tooltip from '@atlaskit/tooltip';
|
|
28
28
|
import { DropdownMenuSharedCssClassName } from '../../styles';
|
|
@@ -94,7 +94,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
94
94
|
_defineProperty(_assertThisInitialized(_this), "handleCloseAndFocus", function (event) {
|
|
95
95
|
var _this$state$target;
|
|
96
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();
|
|
97
|
-
if (
|
|
97
|
+
if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
98
98
|
_this.handleClose(event);
|
|
99
99
|
} else {
|
|
100
100
|
_this.handleClose();
|
|
@@ -103,7 +103,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
103
103
|
_defineProperty(_assertThisInitialized(_this), "handleClose", function (event) {
|
|
104
104
|
var onOpenChange = _this.props.onOpenChange;
|
|
105
105
|
if (onOpenChange) {
|
|
106
|
-
if (
|
|
106
|
+
if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
107
107
|
onOpenChange({
|
|
108
108
|
isOpen: false,
|
|
109
109
|
event: event
|
|
@@ -138,7 +138,8 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
138
138
|
onItemActivated = _this$props.onItemActivated,
|
|
139
139
|
arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions,
|
|
140
140
|
section = _this$props.section,
|
|
141
|
-
|
|
141
|
+
allowEnterDefaultBehavior = _this$props.allowEnterDefaultBehavior,
|
|
142
|
+
handleEscapeKeydown = _this$props.handleEscapeKeydown;
|
|
142
143
|
// Note that this onSelection function can't be refactored to useMemo for
|
|
143
144
|
// performance gains as it is being used as a dependency in a useEffect in
|
|
144
145
|
// MenuArrowKeyNavigationProvider in order to check for re-renders to adjust
|
|
@@ -179,10 +180,10 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
179
180
|
shouldFitContainer: true,
|
|
180
181
|
isTriggerNotTabbable: true,
|
|
181
182
|
handleClickOutside: this.handleClose,
|
|
182
|
-
handleEscapeKeydown: this.handleCloseAndFocus,
|
|
183
|
+
handleEscapeKeydown: fg('platform-editor-a11y-image-border-options-dropdown') ? handleEscapeKeydown || this.handleCloseAndFocus : this.handleCloseAndFocus,
|
|
183
184
|
handleEnterKeydown: function handleEnterKeydown(e) {
|
|
184
|
-
if (
|
|
185
|
-
if (!
|
|
185
|
+
if (fg('platform.editor.a11y-table-context-menu_y4c9c') || fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
186
|
+
if (!allowEnterDefaultBehavior) {
|
|
186
187
|
e.preventDefault();
|
|
187
188
|
}
|
|
188
189
|
} else {
|
|
@@ -244,7 +245,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
244
245
|
key: 'ArrowDown',
|
|
245
246
|
bubbles: true
|
|
246
247
|
});
|
|
247
|
-
if (mountTo &&
|
|
248
|
+
if (mountTo && fg('platform.editor.a11y-main-toolbar-navigation_osrty')) {
|
|
248
249
|
mountTo.dispatchEvent(keyboardEvent);
|
|
249
250
|
return;
|
|
250
251
|
}
|
|
@@ -296,17 +297,38 @@ export function DropdownMenuItem(_ref) {
|
|
|
296
297
|
var _handleSubmenuActive = function _handleSubmenuActive(event) {
|
|
297
298
|
setSubmenuActive(Boolean(event.target instanceof HTMLElement && event.target.closest(".".concat(DropdownMenuSharedCssClassName.SUBMENU))));
|
|
298
299
|
};
|
|
300
|
+
var ariaLabel;
|
|
301
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
302
|
+
ariaLabel = item['aria-label'] === '' ? undefined : item['aria-label'] || String(item.content);
|
|
303
|
+
} else {
|
|
304
|
+
ariaLabel = item['aria-label'] || String(item.content);
|
|
305
|
+
}
|
|
306
|
+
var testId;
|
|
307
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
308
|
+
testId = item['data-testid'] || "dropdown-item__".concat(item.content);
|
|
309
|
+
} else {
|
|
310
|
+
testId = "dropdown-item__".concat(String(item.content));
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// From time to time we don't want to have any tabIndex on item wrapper
|
|
314
|
+
// especially when we pass any interactive element as a item.content
|
|
315
|
+
var tabIndex;
|
|
316
|
+
if (fg('platform-editor-a11y-image-border-options-dropdown')) {
|
|
317
|
+
tabIndex = item.wrapperTabIndex === null ? undefined : item.wrapperTabIndex || -1;
|
|
318
|
+
} else {
|
|
319
|
+
tabIndex = -1;
|
|
320
|
+
}
|
|
299
321
|
var dropListItem = jsx("div", {
|
|
300
322
|
css: function css() {
|
|
301
323
|
return buttonStyles(item.isActive, submenuActive);
|
|
302
324
|
},
|
|
303
|
-
tabIndex:
|
|
325
|
+
tabIndex: tabIndex,
|
|
304
326
|
"aria-disabled": item.isDisabled ? 'true' : 'false',
|
|
305
327
|
onMouseDown: _handleSubmenuActive
|
|
306
328
|
}, jsx(CustomItem, {
|
|
307
329
|
item: item,
|
|
308
330
|
key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
|
|
309
|
-
testId:
|
|
331
|
+
testId: testId,
|
|
310
332
|
role: shouldUseDefaultRole ? 'button' : 'menuitem',
|
|
311
333
|
iconBefore: item.elemBefore,
|
|
312
334
|
iconAfter: item.elemAfter,
|
|
@@ -316,7 +338,7 @@ export function DropdownMenuItem(_ref) {
|
|
|
316
338
|
item: item
|
|
317
339
|
});
|
|
318
340
|
},
|
|
319
|
-
"aria-label":
|
|
341
|
+
"aria-label": ariaLabel,
|
|
320
342
|
"aria-pressed": shouldUseDefaultRole ? item.isActive : undefined,
|
|
321
343
|
"aria-keyshortcuts": item['aria-keyshortcuts'],
|
|
322
344
|
onMouseDown: function onMouseDown(e) {
|
|
@@ -333,7 +355,7 @@ export function DropdownMenuItem(_ref) {
|
|
|
333
355
|
item: item
|
|
334
356
|
});
|
|
335
357
|
},
|
|
336
|
-
"aria-expanded":
|
|
358
|
+
"aria-expanded": fg('platform.editor.a11y-table-context-menu_y4c9c') ? item['aria-expanded'] : undefined
|
|
337
359
|
}, item.content));
|
|
338
360
|
if (item.tooltipDescription) {
|
|
339
361
|
var _item$key3;
|
|
@@ -93,6 +93,7 @@ export declare const toggleHighlightPalette: Keymap;
|
|
|
93
93
|
export declare const focusToContextMenuTrigger: Keymap;
|
|
94
94
|
export declare const dragToMoveUp: Keymap;
|
|
95
95
|
export declare const dragToMoveDown: Keymap;
|
|
96
|
+
export declare const showElementDragHandle: Keymap;
|
|
96
97
|
export declare function tooltip(keymap?: Keymap, description?: string): string | undefined;
|
|
97
98
|
export declare const ToolTipContent: React.MemoExoticComponent<({ description, shortcutOverride, keymap, }: {
|
|
98
99
|
description?: string | React.ReactNode;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export type OnDropdownChange = (isOpen: boolean) => void;
|
|
3
3
|
export type DropdownProps = {
|
|
4
|
+
/** Callback fired when the Configure dropdown item is clicked */
|
|
5
|
+
onConfigureClick: () => void;
|
|
4
6
|
/** Callback fired when the dropdown is open or close */
|
|
5
7
|
onDropdownChange?: OnDropdownChange;
|
|
6
8
|
testId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { type ReactElement } from 'react';
|
|
2
|
+
import React, { type ReactElement } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
export interface Props {
|
|
5
5
|
value: string;
|
|
@@ -7,6 +7,7 @@ export interface Props {
|
|
|
7
7
|
tabIndex?: number;
|
|
8
8
|
isSelected?: boolean;
|
|
9
9
|
onClick: (value: string, label: string) => void;
|
|
10
|
+
onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
|
|
10
11
|
borderColor: string;
|
|
11
12
|
checkMarkColor?: string;
|
|
12
13
|
autoFocus?: boolean;
|
|
@@ -5,6 +5,7 @@ import type { PaletteColor, PaletteTooltipMessages } from './Palettes/type';
|
|
|
5
5
|
interface Props {
|
|
6
6
|
selectedColor: string | null;
|
|
7
7
|
onClick: (value: string, label: string) => void;
|
|
8
|
+
onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
|
|
8
9
|
cols?: number;
|
|
9
10
|
className?: string;
|
|
10
11
|
/**
|
package/dist/types/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ import type { MenuArrowKeyNavigationProviderProps } from '../types';
|
|
|
4
4
|
* This component is a wrapper of vertical menus which listens to keydown events of children
|
|
5
5
|
* and handles up/down arrow key navigation
|
|
6
6
|
*/
|
|
7
|
-
export declare const MenuArrowKeyNavigationProvider: ({ children, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, editorRef, popupsMountPoint, }: React.PropsWithChildren<Omit<MenuArrowKeyNavigationProviderProps, 'type'>>) => JSX.Element;
|
|
7
|
+
export declare const MenuArrowKeyNavigationProvider: ({ children, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, editorRef, popupsMountPoint, disableCloseOnArrowClick, }: React.PropsWithChildren<Omit<MenuArrowKeyNavigationProviderProps, 'type'>>) => JSX.Element;
|
|
@@ -28,6 +28,7 @@ export type MenuArrowKeyNavigationOptions = {
|
|
|
28
28
|
type: ArrowKeyNavigationType.MENU;
|
|
29
29
|
disableArrowKeyNavigation?: boolean;
|
|
30
30
|
keyDownHandlerContext?: KeyDownHandlerContext;
|
|
31
|
+
disableCloseOnArrowClick?: boolean;
|
|
31
32
|
children?: React.ReactNode;
|
|
32
33
|
};
|
|
33
34
|
export type MenuArrowKeyNavigationProviderProps = MenuArrowKeyNavigationOptions & {
|
|
@@ -30,7 +30,8 @@ export interface Props {
|
|
|
30
30
|
arrowKeyNavigationProviderOptions: ArrowKeyNavigationProviderOptions;
|
|
31
31
|
section?: SectionOptions;
|
|
32
32
|
children?: React.ReactNode;
|
|
33
|
-
|
|
33
|
+
allowEnterDefaultBehavior?: boolean;
|
|
34
|
+
handleEscapeKeydown?: (e: KeyboardEvent) => void;
|
|
34
35
|
}
|
|
35
36
|
export interface MenuItem {
|
|
36
37
|
key?: string;
|
|
@@ -50,8 +51,10 @@ export interface MenuItem {
|
|
|
50
51
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
51
52
|
'aria-haspopup'?: React.AriaAttributes['aria-haspopup'];
|
|
52
53
|
'aria-keyshortcuts'?: React.AriaAttributes['aria-keyshortcuts'];
|
|
54
|
+
'data-testid'?: string;
|
|
53
55
|
onClick?: (editorActions: EditorActions) => void;
|
|
54
56
|
'aria-expanded'?: React.AriaAttributes['aria-expanded'];
|
|
57
|
+
wrapperTabIndex?: number | null;
|
|
55
58
|
}
|
|
56
59
|
export interface State {
|
|
57
60
|
target?: HTMLElement;
|
|
@@ -93,6 +93,7 @@ export declare const toggleHighlightPalette: Keymap;
|
|
|
93
93
|
export declare const focusToContextMenuTrigger: Keymap;
|
|
94
94
|
export declare const dragToMoveUp: Keymap;
|
|
95
95
|
export declare const dragToMoveDown: Keymap;
|
|
96
|
+
export declare const showElementDragHandle: Keymap;
|
|
96
97
|
export declare function tooltip(keymap?: Keymap, description?: string): string | undefined;
|
|
97
98
|
export declare const ToolTipContent: React.MemoExoticComponent<({ description, shortcutOverride, keymap, }: {
|
|
98
99
|
description?: string | React.ReactNode;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export type OnDropdownChange = (isOpen: boolean) => void;
|
|
3
3
|
export type DropdownProps = {
|
|
4
|
+
/** Callback fired when the Configure dropdown item is clicked */
|
|
5
|
+
onConfigureClick: () => void;
|
|
4
6
|
/** Callback fired when the dropdown is open or close */
|
|
5
7
|
onDropdownChange?: OnDropdownChange;
|
|
6
8
|
testId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { type ReactElement } from 'react';
|
|
2
|
+
import React, { type ReactElement } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
export interface Props {
|
|
5
5
|
value: string;
|
|
@@ -7,6 +7,7 @@ export interface Props {
|
|
|
7
7
|
tabIndex?: number;
|
|
8
8
|
isSelected?: boolean;
|
|
9
9
|
onClick: (value: string, label: string) => void;
|
|
10
|
+
onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
|
|
10
11
|
borderColor: string;
|
|
11
12
|
checkMarkColor?: string;
|
|
12
13
|
autoFocus?: boolean;
|
|
@@ -5,6 +5,7 @@ import type { PaletteColor, PaletteTooltipMessages } from './Palettes/type';
|
|
|
5
5
|
interface Props {
|
|
6
6
|
selectedColor: string | null;
|
|
7
7
|
onClick: (value: string, label: string) => void;
|
|
8
|
+
onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
|
|
8
9
|
cols?: number;
|
|
9
10
|
className?: string;
|
|
10
11
|
/**
|
|
@@ -4,4 +4,4 @@ import type { MenuArrowKeyNavigationProviderProps } from '../types';
|
|
|
4
4
|
* This component is a wrapper of vertical menus which listens to keydown events of children
|
|
5
5
|
* and handles up/down arrow key navigation
|
|
6
6
|
*/
|
|
7
|
-
export declare const MenuArrowKeyNavigationProvider: ({ children, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, editorRef, popupsMountPoint, }: React.PropsWithChildren<Omit<MenuArrowKeyNavigationProviderProps, 'type'>>) => JSX.Element;
|
|
7
|
+
export declare const MenuArrowKeyNavigationProvider: ({ children, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, editorRef, popupsMountPoint, disableCloseOnArrowClick, }: React.PropsWithChildren<Omit<MenuArrowKeyNavigationProviderProps, 'type'>>) => JSX.Element;
|
|
@@ -28,6 +28,7 @@ export type MenuArrowKeyNavigationOptions = {
|
|
|
28
28
|
type: ArrowKeyNavigationType.MENU;
|
|
29
29
|
disableArrowKeyNavigation?: boolean;
|
|
30
30
|
keyDownHandlerContext?: KeyDownHandlerContext;
|
|
31
|
+
disableCloseOnArrowClick?: boolean;
|
|
31
32
|
children?: React.ReactNode;
|
|
32
33
|
};
|
|
33
34
|
export type MenuArrowKeyNavigationProviderProps = MenuArrowKeyNavigationOptions & {
|
|
@@ -30,7 +30,8 @@ export interface Props {
|
|
|
30
30
|
arrowKeyNavigationProviderOptions: ArrowKeyNavigationProviderOptions;
|
|
31
31
|
section?: SectionOptions;
|
|
32
32
|
children?: React.ReactNode;
|
|
33
|
-
|
|
33
|
+
allowEnterDefaultBehavior?: boolean;
|
|
34
|
+
handleEscapeKeydown?: (e: KeyboardEvent) => void;
|
|
34
35
|
}
|
|
35
36
|
export interface MenuItem {
|
|
36
37
|
key?: string;
|
|
@@ -50,8 +51,10 @@ export interface MenuItem {
|
|
|
50
51
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
51
52
|
'aria-haspopup'?: React.AriaAttributes['aria-haspopup'];
|
|
52
53
|
'aria-keyshortcuts'?: React.AriaAttributes['aria-keyshortcuts'];
|
|
54
|
+
'data-testid'?: string;
|
|
53
55
|
onClick?: (editorActions: EditorActions) => void;
|
|
54
56
|
'aria-expanded'?: React.AriaAttributes['aria-expanded'];
|
|
57
|
+
wrapperTabIndex?: number | null;
|
|
55
58
|
}
|
|
56
59
|
export interface State {
|
|
57
60
|
target?: HTMLElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "85.
|
|
3
|
+
"version": "85.2.0",
|
|
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/"
|
|
@@ -243,6 +243,9 @@
|
|
|
243
243
|
"platform_editor_tables_padding_increase": {
|
|
244
244
|
"type": "boolean"
|
|
245
245
|
},
|
|
246
|
+
"platform-editor-a11y-image-border-options-dropdown": {
|
|
247
|
+
"type": "boolean"
|
|
248
|
+
},
|
|
246
249
|
"platform.editor.a11y-table-context-menu_y4c9c": {
|
|
247
250
|
"type": "boolean"
|
|
248
251
|
},
|