@atlaskit/editor-plugin-block-menu 6.0.31 → 6.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/ui/block-menu.js +14 -1
- package/dist/es2019/ui/block-menu.js +14 -1
- package/dist/esm/ui/block-menu.js +14 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-menu
|
|
2
2
|
|
|
3
|
+
## 6.0.33
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3b3aa281c8524`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b3aa281c8524) -
|
|
8
|
+
Editor 4149 Fix keyboard navigation inside turn into
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.0.32
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`9b8e6a65567af`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9b8e6a65567af) -
|
|
16
|
+
ENGHEALTH-48871: Add missing menu role to block menu.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 6.0.31
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -23,6 +23,7 @@ var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
|
23
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
24
24
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
25
25
|
var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
|
|
26
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
26
27
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
27
28
|
var _blockMenuProvider = require("./block-menu-provider");
|
|
28
29
|
var _BlockMenuRenderer = require("./block-menu-renderer/BlockMenuRenderer");
|
|
@@ -86,15 +87,27 @@ var BlockMenuContent = function BlockMenuContent(_ref2) {
|
|
|
86
87
|
setOutsideClickTargetRef(el);
|
|
87
88
|
setRef === null || setRef === void 0 || setRef(el);
|
|
88
89
|
};
|
|
90
|
+
var shouldDisableArrowKeyNavigation = function shouldDisableArrowKeyNavigation(event) {
|
|
91
|
+
if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
var target = event.target;
|
|
95
|
+
if (!(target instanceof HTMLElement)) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
return target.closest('[data-toolbar-nested-dropdown-menu]') !== null;
|
|
99
|
+
};
|
|
89
100
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
90
101
|
testId: "editor-block-menu",
|
|
102
|
+
role: (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menu' : undefined,
|
|
91
103
|
ref: ref,
|
|
92
104
|
xcss: (0, _css.cx)(styles.base, (0, _experiments.editorExperiment)('platform_synced_block', true) && styles.emptyMenuSectionStyles)
|
|
93
105
|
}, /*#__PURE__*/_react.default.createElement(_uiMenu.ArrowKeyNavigationProvider, {
|
|
94
106
|
type: _uiMenu.ArrowKeyNavigationType.MENU,
|
|
95
107
|
handleClose: function handleClose(e) {
|
|
96
108
|
return e.preventDefault();
|
|
97
|
-
}
|
|
109
|
+
},
|
|
110
|
+
disableArrowKeyNavigation: shouldDisableArrowKeyNavigation
|
|
98
111
|
}, /*#__PURE__*/_react.default.createElement(_BlockMenuRenderer.BlockMenuRenderer, {
|
|
99
112
|
allRegisteredComponents: blockMenuComponents || []
|
|
100
113
|
})));
|
|
@@ -14,6 +14,7 @@ import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners } from
|
|
|
14
14
|
import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
15
15
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
16
16
|
import { redo, undo } from '@atlaskit/prosemirror-history';
|
|
17
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
18
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
18
19
|
import { useBlockMenu } from './block-menu-provider';
|
|
19
20
|
import { BlockMenuRenderer } from './block-menu-renderer/BlockMenuRenderer';
|
|
@@ -79,13 +80,25 @@ const BlockMenuContent = ({
|
|
|
79
80
|
setOutsideClickTargetRef(el);
|
|
80
81
|
setRef === null || setRef === void 0 ? void 0 : setRef(el);
|
|
81
82
|
};
|
|
83
|
+
const shouldDisableArrowKeyNavigation = event => {
|
|
84
|
+
if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
const target = event.target;
|
|
88
|
+
if (!(target instanceof HTMLElement)) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
return target.closest('[data-toolbar-nested-dropdown-menu]') !== null;
|
|
92
|
+
};
|
|
82
93
|
return /*#__PURE__*/React.createElement(Box, {
|
|
83
94
|
testId: "editor-block-menu",
|
|
95
|
+
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menu' : undefined,
|
|
84
96
|
ref: ref,
|
|
85
97
|
xcss: cx(styles.base, editorExperiment('platform_synced_block', true) && styles.emptyMenuSectionStyles)
|
|
86
98
|
}, /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
87
99
|
type: ArrowKeyNavigationType.MENU,
|
|
88
|
-
handleClose: e => e.preventDefault()
|
|
100
|
+
handleClose: e => e.preventDefault(),
|
|
101
|
+
disableArrowKeyNavigation: shouldDisableArrowKeyNavigation
|
|
89
102
|
}, /*#__PURE__*/React.createElement(BlockMenuRenderer, {
|
|
90
103
|
allRegisteredComponents: blockMenuComponents || []
|
|
91
104
|
})));
|
|
@@ -15,6 +15,7 @@ import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners } from
|
|
|
15
15
|
import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
16
16
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
17
17
|
import { redo, undo } from '@atlaskit/prosemirror-history';
|
|
18
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
19
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
20
|
import { useBlockMenu } from './block-menu-provider';
|
|
20
21
|
import { BlockMenuRenderer } from './block-menu-renderer/BlockMenuRenderer';
|
|
@@ -77,15 +78,27 @@ var BlockMenuContent = function BlockMenuContent(_ref2) {
|
|
|
77
78
|
setOutsideClickTargetRef(el);
|
|
78
79
|
setRef === null || setRef === void 0 || setRef(el);
|
|
79
80
|
};
|
|
81
|
+
var shouldDisableArrowKeyNavigation = function shouldDisableArrowKeyNavigation(event) {
|
|
82
|
+
if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
var target = event.target;
|
|
86
|
+
if (!(target instanceof HTMLElement)) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
return target.closest('[data-toolbar-nested-dropdown-menu]') !== null;
|
|
90
|
+
};
|
|
80
91
|
return /*#__PURE__*/React.createElement(Box, {
|
|
81
92
|
testId: "editor-block-menu",
|
|
93
|
+
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menu' : undefined,
|
|
82
94
|
ref: ref,
|
|
83
95
|
xcss: cx(styles.base, editorExperiment('platform_synced_block', true) && styles.emptyMenuSectionStyles)
|
|
84
96
|
}, /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
85
97
|
type: ArrowKeyNavigationType.MENU,
|
|
86
98
|
handleClose: function handleClose(e) {
|
|
87
99
|
return e.preventDefault();
|
|
88
|
-
}
|
|
100
|
+
},
|
|
101
|
+
disableArrowKeyNavigation: shouldDisableArrowKeyNavigation
|
|
89
102
|
}, /*#__PURE__*/React.createElement(BlockMenuRenderer, {
|
|
90
103
|
allRegisteredComponents: blockMenuComponents || []
|
|
91
104
|
})));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.33",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
47
47
|
"@atlaskit/primitives": "^18.0.0",
|
|
48
48
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^20.0.0",
|
|
50
50
|
"@atlaskit/tokens": "^11.0.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"bind-event-listener": "^3.0.0"
|