@atlaskit/editor-plugin-block-menu 6.0.32 → 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 CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ## 6.0.32
4
12
 
5
13
  ### Patch Changes
@@ -87,6 +87,16 @@ var BlockMenuContent = function BlockMenuContent(_ref2) {
87
87
  setOutsideClickTargetRef(el);
88
88
  setRef === null || setRef === void 0 || setRef(el);
89
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
+ };
90
100
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
91
101
  testId: "editor-block-menu",
92
102
  role: (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menu' : undefined,
@@ -96,7 +106,8 @@ var BlockMenuContent = function BlockMenuContent(_ref2) {
96
106
  type: _uiMenu.ArrowKeyNavigationType.MENU,
97
107
  handleClose: function handleClose(e) {
98
108
  return e.preventDefault();
99
- }
109
+ },
110
+ disableArrowKeyNavigation: shouldDisableArrowKeyNavigation
100
111
  }, /*#__PURE__*/_react.default.createElement(_BlockMenuRenderer.BlockMenuRenderer, {
101
112
  allRegisteredComponents: blockMenuComponents || []
102
113
  })));
@@ -80,6 +80,16 @@ const BlockMenuContent = ({
80
80
  setOutsideClickTargetRef(el);
81
81
  setRef === null || setRef === void 0 ? void 0 : setRef(el);
82
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
+ };
83
93
  return /*#__PURE__*/React.createElement(Box, {
84
94
  testId: "editor-block-menu",
85
95
  role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menu' : undefined,
@@ -87,7 +97,8 @@ const BlockMenuContent = ({
87
97
  xcss: cx(styles.base, editorExperiment('platform_synced_block', true) && styles.emptyMenuSectionStyles)
88
98
  }, /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
89
99
  type: ArrowKeyNavigationType.MENU,
90
- handleClose: e => e.preventDefault()
100
+ handleClose: e => e.preventDefault(),
101
+ disableArrowKeyNavigation: shouldDisableArrowKeyNavigation
91
102
  }, /*#__PURE__*/React.createElement(BlockMenuRenderer, {
92
103
  allRegisteredComponents: blockMenuComponents || []
93
104
  })));
@@ -78,6 +78,16 @@ var BlockMenuContent = function BlockMenuContent(_ref2) {
78
78
  setOutsideClickTargetRef(el);
79
79
  setRef === null || setRef === void 0 || setRef(el);
80
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
+ };
81
91
  return /*#__PURE__*/React.createElement(Box, {
82
92
  testId: "editor-block-menu",
83
93
  role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menu' : undefined,
@@ -87,7 +97,8 @@ var BlockMenuContent = function BlockMenuContent(_ref2) {
87
97
  type: ArrowKeyNavigationType.MENU,
88
98
  handleClose: function handleClose(e) {
89
99
  return e.preventDefault();
90
- }
100
+ },
101
+ disableArrowKeyNavigation: shouldDisableArrowKeyNavigation
91
102
  }, /*#__PURE__*/React.createElement(BlockMenuRenderer, {
92
103
  allRegisteredComponents: blockMenuComponents || []
93
104
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "6.0.32",
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": "^19.0.0",
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"