@atlaskit/editor-common 84.5.1 → 85.1.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 +38 -0
- package/dist/cjs/analytics/types/enums.js +2 -0
- package/dist/cjs/extensibility/extensionNodeView.js +1 -2
- package/dist/cjs/keymaps/index.js +3 -2
- package/dist/cjs/keymaps/keymap.js +25 -43
- package/dist/cjs/link/ConfigureLinkOverlay/Dropdown.js +34 -9
- package/dist/cjs/link/ConfigureLinkOverlay/index.js +15 -5
- package/dist/cjs/link/ConfigureLinkOverlay/useLinkOverlayAnalyticsEvents.js +46 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +2 -4
- package/dist/cjs/react-node-view/index.js +4 -10
- package/dist/cjs/selection-based-node-view/SelectionBasedNodeView.js +2 -5
- 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/analytics/types/enums.js +2 -0
- package/dist/es2019/extensibility/extensionNodeView.js +1 -2
- package/dist/es2019/keymaps/index.js +1 -0
- package/dist/es2019/keymaps/keymap.js +25 -43
- package/dist/es2019/link/ConfigureLinkOverlay/Dropdown.js +33 -7
- package/dist/es2019/link/ConfigureLinkOverlay/index.js +16 -5
- package/dist/es2019/link/ConfigureLinkOverlay/useLinkOverlayAnalyticsEvents.js +39 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +2 -4
- package/dist/es2019/react-node-view/index.js +5 -7
- package/dist/es2019/selection-based-node-view/SelectionBasedNodeView.js +3 -2
- 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/analytics/types/enums.js +2 -0
- package/dist/esm/extensibility/extensionNodeView.js +1 -2
- package/dist/esm/keymaps/index.js +1 -0
- package/dist/esm/keymaps/keymap.js +25 -43
- package/dist/esm/link/ConfigureLinkOverlay/Dropdown.js +34 -9
- package/dist/esm/link/ConfigureLinkOverlay/index.js +15 -5
- package/dist/esm/link/ConfigureLinkOverlay/useLinkOverlayAnalyticsEvents.js +40 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +2 -4
- package/dist/esm/react-node-view/index.js +4 -10
- package/dist/esm/selection-based-node-view/SelectionBasedNodeView.js +3 -5
- 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/analytics/types/enums.d.ts +3 -1
- package/dist/types/extensibility/extensionNodeView.d.ts +1 -2
- package/dist/types/keymaps/index.d.ts +1 -0
- package/dist/types/link/ConfigureLinkOverlay/Dropdown.d.ts +5 -4
- package/dist/types/link/ConfigureLinkOverlay/index.d.ts +2 -2
- package/dist/types/link/ConfigureLinkOverlay/useLinkOverlayAnalyticsEvents.d.ts +5 -0
- package/dist/types/react-node-view/index.d.ts +2 -5
- package/dist/types/selection-based-node-view/SelectionBasedNodeView.d.ts +1 -2
- package/dist/types/types/plugin-factory.d.ts +1 -2
- 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/analytics/types/enums.d.ts +3 -1
- package/dist/types-ts4.5/extensibility/extensionNodeView.d.ts +1 -2
- package/dist/types-ts4.5/keymaps/index.d.ts +1 -0
- package/dist/types-ts4.5/link/ConfigureLinkOverlay/Dropdown.d.ts +5 -4
- package/dist/types-ts4.5/link/ConfigureLinkOverlay/index.d.ts +2 -2
- package/dist/types-ts4.5/link/ConfigureLinkOverlay/useLinkOverlayAnalyticsEvents.d.ts +5 -0
- package/dist/types-ts4.5/react-node-view/index.d.ts +2 -5
- package/dist/types-ts4.5/selection-based-node-view/SelectionBasedNodeView.d.ts +1 -2
- package/dist/types-ts4.5/types/plugin-factory.d.ts +1 -2
- 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 -6
- package/dist/cjs/ui/PortalProvider/index.js +0 -235
- package/dist/es2019/ui/PortalProvider/index.js +0 -171
- package/dist/esm/ui/PortalProvider/index.js +0 -229
- package/dist/types/ui/PortalProvider/index.d.ts +0 -48
- package/dist/types-ts4.5/ui/PortalProvider/index.d.ts +0 -48
- package/portal-provider/package.json +0 -15
|
@@ -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;
|
|
@@ -238,7 +238,8 @@ export declare enum ACTION_SUBJECT {
|
|
|
238
238
|
DROP_TARGET = "dropTarget",
|
|
239
239
|
DRAG = "drag",
|
|
240
240
|
ELEMENT = "element",
|
|
241
|
-
CONTEXT_MENU = "contextMenu"
|
|
241
|
+
CONTEXT_MENU = "contextMenu",
|
|
242
|
+
INLINE_DIALOG = "inlineDialog"
|
|
242
243
|
}
|
|
243
244
|
export declare enum ACTION_SUBJECT_ID {
|
|
244
245
|
ACTION = "action",
|
|
@@ -352,6 +353,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
352
353
|
SAVE = "save",
|
|
353
354
|
SECTION = "section",
|
|
354
355
|
SMART_LINK = "smartLink",
|
|
356
|
+
SMART_LINK_TOOLBAR = "smartLinkToolbar",
|
|
355
357
|
STATUS = "status",
|
|
356
358
|
SYMBOL = "symbol",
|
|
357
359
|
TABLE = "table",
|
|
@@ -8,7 +8,6 @@ import type { ProviderFactory } from '../provider-factory';
|
|
|
8
8
|
import type { ForwardRef, getPosHandler } from '../react-node-view';
|
|
9
9
|
import ReactNodeView from '../react-node-view';
|
|
10
10
|
import type { EditorAppearance } from '../types';
|
|
11
|
-
import type { LegacyPortalProviderAPI } from '../ui/PortalProvider';
|
|
12
11
|
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from './types';
|
|
13
12
|
interface ExtensionNodeViewOptions {
|
|
14
13
|
appearance?: EditorAppearance;
|
|
@@ -29,5 +28,5 @@ export declare class ExtensionNode extends ReactNodeView {
|
|
|
29
28
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
30
29
|
}, forwardRef: ForwardRef): JSX.Element;
|
|
31
30
|
}
|
|
32
|
-
export default function ExtensionNodeView(portalProviderAPI:
|
|
31
|
+
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
33
32
|
export {};
|
|
@@ -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,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export type OnDropdownChange = (isOpen: boolean) => void;
|
|
3
3
|
export type DropdownProps = {
|
|
4
|
-
|
|
4
|
+
/** Callback fired when the dropdown is open or close */
|
|
5
5
|
onDropdownChange?: OnDropdownChange;
|
|
6
|
+
testId: string;
|
|
6
7
|
};
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
8
|
+
declare const _default: import("react").ForwardRefExoticComponent<DropdownProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
9
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import { type OnDropdownChange } from './Dropdown';
|
|
4
4
|
export interface OverlayButtonProps {
|
|
@@ -10,4 +10,4 @@ export interface OverlayButtonProps {
|
|
|
10
10
|
*/
|
|
11
11
|
onDropdownChange?: OnDropdownChange;
|
|
12
12
|
}
|
|
13
|
-
export declare const OverlayButton: (
|
|
13
|
+
export declare const OverlayButton: import("react").ForwardRefExoticComponent<OverlayButtonProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -3,7 +3,6 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { EventDispatcher } from '../event-dispatcher';
|
|
5
5
|
import type { PortalProviderAPI } from '../portal';
|
|
6
|
-
import type { LegacyPortalProviderAPI } from '../ui/PortalProvider';
|
|
7
6
|
import type { ForwardRef, getPosHandler, ProsemirrorGetPosHandler, ReactComponentProps, shouldUpdate } from './types';
|
|
8
7
|
export type { getPosHandler, ReactComponentProps, shouldUpdate, ProsemirrorGetPosHandler, ForwardRef, };
|
|
9
8
|
export type { InlineNodeViewComponentProps } from './getInlineNodeViewProducer';
|
|
@@ -13,10 +12,8 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
13
12
|
private contentDOMWrapper?;
|
|
14
13
|
private reactComponent?;
|
|
15
14
|
private portalProviderAPI;
|
|
16
|
-
private hasAnalyticsContext;
|
|
17
15
|
private _viewShouldUpdate?;
|
|
18
16
|
protected eventDispatcher?: EventDispatcher;
|
|
19
|
-
private hasIntlContext;
|
|
20
17
|
protected decorations: ReadonlyArray<Decoration>;
|
|
21
18
|
reactComponentProps: P;
|
|
22
19
|
view: EditorView;
|
|
@@ -24,7 +21,7 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
24
21
|
contentDOM: HTMLElement | null | undefined;
|
|
25
22
|
node: PMNode;
|
|
26
23
|
key: string;
|
|
27
|
-
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI:
|
|
24
|
+
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps?: P, reactComponent?: React.ComponentType<React.PropsWithChildren<any>>, viewShouldUpdate?: shouldUpdate);
|
|
28
25
|
/**
|
|
29
26
|
* This method exists to move initialization logic out of the constructor,
|
|
30
27
|
* so object can be initialized properly before calling render first time.
|
|
@@ -54,5 +51,5 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
54
51
|
get dom(): HTMLElement;
|
|
55
52
|
destroy(): void;
|
|
56
53
|
private dispatchAnalyticsEvent;
|
|
57
|
-
static fromComponent(component: React.ComponentType<React.PropsWithChildren<any>>, portalProviderAPI:
|
|
54
|
+
static fromComponent(component: React.ComponentType<React.PropsWithChildren<any>>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, props?: ReactComponentProps, viewShouldUpdate?: (nextNode: PMNode) => boolean): (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<ReactComponentProps>;
|
|
58
55
|
}
|
|
@@ -4,7 +4,6 @@ import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import { type EventDispatcher } from '../event-dispatcher';
|
|
5
5
|
import { type PortalProviderAPI } from '../portal';
|
|
6
6
|
import ReactNodeView, { type getPosHandler, type ReactComponentProps, type shouldUpdate } from '../react-node-view';
|
|
7
|
-
import type { LegacyPortalProviderAPI } from '../ui/PortalProvider';
|
|
8
7
|
/**
|
|
9
8
|
* A ReactNodeView that handles React components sensitive
|
|
10
9
|
* to selection changes.
|
|
@@ -32,7 +31,7 @@ export declare class SelectionBasedNodeView<P = ReactComponentProps> extends Rea
|
|
|
32
31
|
protected isSelectedNode: boolean;
|
|
33
32
|
pos: number | undefined;
|
|
34
33
|
posEnd: number | undefined;
|
|
35
|
-
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI:
|
|
34
|
+
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps: P, reactComponent?: React.ComponentType<React.PropsWithChildren<any>>, viewShouldUpdate?: shouldUpdate);
|
|
36
35
|
/**
|
|
37
36
|
* Update current node's start and end positions.
|
|
38
37
|
*
|
|
@@ -5,7 +5,6 @@ import type { Dispatch, EventDispatcher } from '../event-dispatcher';
|
|
|
5
5
|
import { type PortalProviderAPI } from '../portal';
|
|
6
6
|
import type { ProviderFactory } from '../provider-factory';
|
|
7
7
|
import type { SafePlugin } from '../safe-plugin';
|
|
8
|
-
import type { LegacyPortalProviderAPI } from '../ui/PortalProvider';
|
|
9
8
|
import type { ErrorReporter } from '../utils';
|
|
10
9
|
import type { EditorReactContext } from './editor-react-context';
|
|
11
10
|
import type { FeatureFlags } from './feature-flags';
|
|
@@ -15,7 +14,7 @@ export type PMPluginFactoryParams = {
|
|
|
15
14
|
eventDispatcher: EventDispatcher;
|
|
16
15
|
providerFactory: ProviderFactory;
|
|
17
16
|
errorReporter?: ErrorReporter;
|
|
18
|
-
portalProviderAPI:
|
|
17
|
+
portalProviderAPI: PortalProviderAPI;
|
|
19
18
|
reactContext: () => EditorReactContext;
|
|
20
19
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
21
20
|
featureFlags: FeatureFlags;
|
|
@@ -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;
|
|
@@ -238,7 +238,8 @@ export declare enum ACTION_SUBJECT {
|
|
|
238
238
|
DROP_TARGET = "dropTarget",
|
|
239
239
|
DRAG = "drag",
|
|
240
240
|
ELEMENT = "element",
|
|
241
|
-
CONTEXT_MENU = "contextMenu"
|
|
241
|
+
CONTEXT_MENU = "contextMenu",
|
|
242
|
+
INLINE_DIALOG = "inlineDialog"
|
|
242
243
|
}
|
|
243
244
|
export declare enum ACTION_SUBJECT_ID {
|
|
244
245
|
ACTION = "action",
|
|
@@ -352,6 +353,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
352
353
|
SAVE = "save",
|
|
353
354
|
SECTION = "section",
|
|
354
355
|
SMART_LINK = "smartLink",
|
|
356
|
+
SMART_LINK_TOOLBAR = "smartLinkToolbar",
|
|
355
357
|
STATUS = "status",
|
|
356
358
|
SYMBOL = "symbol",
|
|
357
359
|
TABLE = "table",
|
|
@@ -8,7 +8,6 @@ import type { ProviderFactory } from '../provider-factory';
|
|
|
8
8
|
import type { ForwardRef, getPosHandler } from '../react-node-view';
|
|
9
9
|
import ReactNodeView from '../react-node-view';
|
|
10
10
|
import type { EditorAppearance } from '../types';
|
|
11
|
-
import type { LegacyPortalProviderAPI } from '../ui/PortalProvider';
|
|
12
11
|
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from './types';
|
|
13
12
|
interface ExtensionNodeViewOptions {
|
|
14
13
|
appearance?: EditorAppearance;
|
|
@@ -29,5 +28,5 @@ export declare class ExtensionNode extends ReactNodeView {
|
|
|
29
28
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
30
29
|
}, forwardRef: ForwardRef): JSX.Element;
|
|
31
30
|
}
|
|
32
|
-
export default function ExtensionNodeView(portalProviderAPI:
|
|
31
|
+
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
33
32
|
export {};
|
|
@@ -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,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export type OnDropdownChange = (isOpen: boolean) => void;
|
|
3
3
|
export type DropdownProps = {
|
|
4
|
-
|
|
4
|
+
/** Callback fired when the dropdown is open or close */
|
|
5
5
|
onDropdownChange?: OnDropdownChange;
|
|
6
|
+
testId: string;
|
|
6
7
|
};
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
8
|
+
declare const _default: import("react").ForwardRefExoticComponent<DropdownProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
9
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import { type OnDropdownChange } from './Dropdown';
|
|
4
4
|
export interface OverlayButtonProps {
|
|
@@ -10,4 +10,4 @@ export interface OverlayButtonProps {
|
|
|
10
10
|
*/
|
|
11
11
|
onDropdownChange?: OnDropdownChange;
|
|
12
12
|
}
|
|
13
|
-
export declare const OverlayButton: (
|
|
13
|
+
export declare const OverlayButton: import("react").ForwardRefExoticComponent<OverlayButtonProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -3,7 +3,6 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { EventDispatcher } from '../event-dispatcher';
|
|
5
5
|
import type { PortalProviderAPI } from '../portal';
|
|
6
|
-
import type { LegacyPortalProviderAPI } from '../ui/PortalProvider';
|
|
7
6
|
import type { ForwardRef, getPosHandler, ProsemirrorGetPosHandler, ReactComponentProps, shouldUpdate } from './types';
|
|
8
7
|
export type { getPosHandler, ReactComponentProps, shouldUpdate, ProsemirrorGetPosHandler, ForwardRef, };
|
|
9
8
|
export type { InlineNodeViewComponentProps } from './getInlineNodeViewProducer';
|
|
@@ -13,10 +12,8 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
13
12
|
private contentDOMWrapper?;
|
|
14
13
|
private reactComponent?;
|
|
15
14
|
private portalProviderAPI;
|
|
16
|
-
private hasAnalyticsContext;
|
|
17
15
|
private _viewShouldUpdate?;
|
|
18
16
|
protected eventDispatcher?: EventDispatcher;
|
|
19
|
-
private hasIntlContext;
|
|
20
17
|
protected decorations: ReadonlyArray<Decoration>;
|
|
21
18
|
reactComponentProps: P;
|
|
22
19
|
view: EditorView;
|
|
@@ -24,7 +21,7 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
24
21
|
contentDOM: HTMLElement | null | undefined;
|
|
25
22
|
node: PMNode;
|
|
26
23
|
key: string;
|
|
27
|
-
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI:
|
|
24
|
+
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps?: P, reactComponent?: React.ComponentType<React.PropsWithChildren<any>>, viewShouldUpdate?: shouldUpdate);
|
|
28
25
|
/**
|
|
29
26
|
* This method exists to move initialization logic out of the constructor,
|
|
30
27
|
* so object can be initialized properly before calling render first time.
|
|
@@ -54,5 +51,5 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
54
51
|
get dom(): HTMLElement;
|
|
55
52
|
destroy(): void;
|
|
56
53
|
private dispatchAnalyticsEvent;
|
|
57
|
-
static fromComponent(component: React.ComponentType<React.PropsWithChildren<any>>, portalProviderAPI:
|
|
54
|
+
static fromComponent(component: React.ComponentType<React.PropsWithChildren<any>>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, props?: ReactComponentProps, viewShouldUpdate?: (nextNode: PMNode) => boolean): (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<ReactComponentProps>;
|
|
58
55
|
}
|
|
@@ -4,7 +4,6 @@ import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import { type EventDispatcher } from '../event-dispatcher';
|
|
5
5
|
import { type PortalProviderAPI } from '../portal';
|
|
6
6
|
import ReactNodeView, { type getPosHandler, type ReactComponentProps, type shouldUpdate } from '../react-node-view';
|
|
7
|
-
import type { LegacyPortalProviderAPI } from '../ui/PortalProvider';
|
|
8
7
|
/**
|
|
9
8
|
* A ReactNodeView that handles React components sensitive
|
|
10
9
|
* to selection changes.
|
|
@@ -32,7 +31,7 @@ export declare class SelectionBasedNodeView<P = ReactComponentProps> extends Rea
|
|
|
32
31
|
protected isSelectedNode: boolean;
|
|
33
32
|
pos: number | undefined;
|
|
34
33
|
posEnd: number | undefined;
|
|
35
|
-
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI:
|
|
34
|
+
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps: P, reactComponent?: React.ComponentType<React.PropsWithChildren<any>>, viewShouldUpdate?: shouldUpdate);
|
|
36
35
|
/**
|
|
37
36
|
* Update current node's start and end positions.
|
|
38
37
|
*
|
|
@@ -5,7 +5,6 @@ import type { Dispatch, EventDispatcher } from '../event-dispatcher';
|
|
|
5
5
|
import { type PortalProviderAPI } from '../portal';
|
|
6
6
|
import type { ProviderFactory } from '../provider-factory';
|
|
7
7
|
import type { SafePlugin } from '../safe-plugin';
|
|
8
|
-
import type { LegacyPortalProviderAPI } from '../ui/PortalProvider';
|
|
9
8
|
import type { ErrorReporter } from '../utils';
|
|
10
9
|
import type { EditorReactContext } from './editor-react-context';
|
|
11
10
|
import type { FeatureFlags } from './feature-flags';
|
|
@@ -15,7 +14,7 @@ export type PMPluginFactoryParams = {
|
|
|
15
14
|
eventDispatcher: EventDispatcher;
|
|
16
15
|
providerFactory: ProviderFactory;
|
|
17
16
|
errorReporter?: ErrorReporter;
|
|
18
|
-
portalProviderAPI:
|
|
17
|
+
portalProviderAPI: PortalProviderAPI;
|
|
19
18
|
reactContext: () => EditorReactContext;
|
|
20
19
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
21
20
|
featureFlags: FeatureFlags;
|
|
@@ -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;
|