@atlaskit/editor-plugin-block-menu 9.2.10 → 9.2.12

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,19 @@
1
1
  # @atlaskit/editor-plugin-block-menu
2
2
 
3
+ ## 9.2.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d3af55fada546`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d3af55fada546) -
8
+ [ux] Adds shouldIgnoreCloseEvent to prevent sub-menus of Block menu from closing when
9
+ changeboarding spotlights get dismissed.
10
+
11
+ ## 9.2.11
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 9.2.10
4
18
 
5
19
  ### Patch Changes
@@ -17,6 +17,10 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
17
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
18
  var _consts = require("./consts");
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
+ var BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR = '[data-test-id="block-menu-transform-spotlight-portal-container"]';
21
+ var shouldIgnoreBlockMenuTransformSpotlightCloseEvent = function shouldIgnoreBlockMenuTransformSpotlightCloseEvent(event) {
22
+ return event.target instanceof Element && event.target.closest(BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR) !== null;
23
+ };
20
24
  var FormatMenuComponent = exports.FormatMenuComponent = function FormatMenuComponent(_ref) {
21
25
  var api = _ref.api,
22
26
  children = _ref.children;
@@ -55,6 +59,7 @@ var FormatMenuComponent = exports.FormatMenuComponent = function FormatMenuCompo
55
59
  onClick: handleClick,
56
60
  dropdownTestId: "editor-turn-into-menu",
57
61
  testId: (0, _platformFeatureFlags.fg)('cc_blocks_changeboarding') ? 'turn-into-block-menu-btn' : undefined,
58
- shouldFitContainer: true
62
+ shouldFitContainer: true,
63
+ shouldIgnoreCloseEvent: (0, _platformFeatureFlags.fg)('cc_blocks_changeboarding') ? shouldIgnoreBlockMenuTransformSpotlightCloseEvent : undefined
59
64
  }, children);
60
65
  };
@@ -8,6 +8,8 @@ import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
10
  import { BLOCK_MENU_ITEM_NAME } from './consts';
11
+ const BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR = '[data-test-id="block-menu-transform-spotlight-portal-container"]';
12
+ const shouldIgnoreBlockMenuTransformSpotlightCloseEvent = event => event.target instanceof Element && event.target.closest(BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR) !== null;
11
13
  export const FormatMenuComponent = ({
12
14
  api,
13
15
  children
@@ -49,6 +51,7 @@ export const FormatMenuComponent = ({
49
51
  onClick: handleClick,
50
52
  dropdownTestId: "editor-turn-into-menu",
51
53
  testId: fg('cc_blocks_changeboarding') ? 'turn-into-block-menu-btn' : undefined,
52
- shouldFitContainer: true
54
+ shouldFitContainer: true,
55
+ shouldIgnoreCloseEvent: fg('cc_blocks_changeboarding') ? shouldIgnoreBlockMenuTransformSpotlightCloseEvent : undefined
53
56
  }, children);
54
57
  };
@@ -8,6 +8,10 @@ import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
10
  import { BLOCK_MENU_ITEM_NAME } from './consts';
11
+ var BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR = '[data-test-id="block-menu-transform-spotlight-portal-container"]';
12
+ var shouldIgnoreBlockMenuTransformSpotlightCloseEvent = function shouldIgnoreBlockMenuTransformSpotlightCloseEvent(event) {
13
+ return event.target instanceof Element && event.target.closest(BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR) !== null;
14
+ };
11
15
  export var FormatMenuComponent = function FormatMenuComponent(_ref) {
12
16
  var api = _ref.api,
13
17
  children = _ref.children;
@@ -46,6 +50,7 @@ export var FormatMenuComponent = function FormatMenuComponent(_ref) {
46
50
  onClick: handleClick,
47
51
  dropdownTestId: "editor-turn-into-menu",
48
52
  testId: fg('cc_blocks_changeboarding') ? 'turn-into-block-menu-btn' : undefined,
49
- shouldFitContainer: true
53
+ shouldFitContainer: true,
54
+ shouldIgnoreCloseEvent: fg('cc_blocks_changeboarding') ? shouldIgnoreBlockMenuTransformSpotlightCloseEvent : undefined
50
55
  }, children);
51
56
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "9.2.10",
3
+ "version": "9.2.12",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,19 +38,19 @@
38
38
  "@atlaskit/editor-prosemirror": "^7.3.0",
39
39
  "@atlaskit/editor-shared-styles": "^3.11.0",
40
40
  "@atlaskit/editor-tables": "^2.10.0",
41
- "@atlaskit/editor-toolbar": "^1.8.0",
41
+ "@atlaskit/editor-toolbar": "^1.9.0",
42
42
  "@atlaskit/flag": "^17.12.0",
43
43
  "@atlaskit/icon": "^35.3.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/primitives": "^19.0.0",
46
46
  "@atlaskit/prosemirror-history": "^0.2.0",
47
- "@atlaskit/tmp-editor-statsig": "^84.2.0",
48
- "@atlaskit/tokens": "^13.0.0",
47
+ "@atlaskit/tmp-editor-statsig": "^85.0.0",
48
+ "@atlaskit/tokens": "^13.1.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "bind-event-listener": "^3.0.0"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^114.48.0",
53
+ "@atlaskit/editor-common": "^114.51.0",
54
54
  "react": "^18.2.0",
55
55
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
56
56
  },