@atlaskit/editor-plugin-block-menu 5.0.19 → 5.0.21
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 +18 -0
- package/afm-cc/tsconfig.json +4 -4
- package/afm-jira/tsconfig.json +0 -3
- package/afm-products/tsconfig.json +0 -3
- package/dist/cjs/ui/block-menu-renderer.js +3 -4
- package/dist/cjs/ui/block-menu.js +6 -6
- package/dist/cjs/ui/delete-button.js +4 -30
- package/dist/cjs/ui/format-menu-nested.js +1 -5
- package/dist/cjs/ui/format-menu-section.js +1 -4
- package/dist/es2019/ui/block-menu-renderer.js +3 -4
- package/dist/es2019/ui/block-menu.js +6 -6
- package/dist/es2019/ui/delete-button.js +4 -30
- package/dist/es2019/ui/format-menu-nested.js +1 -5
- package/dist/es2019/ui/format-menu-section.js +1 -4
- package/dist/esm/ui/block-menu-renderer.js +3 -4
- package/dist/esm/ui/block-menu.js +6 -6
- package/dist/esm/ui/delete-button.js +4 -30
- package/dist/esm/ui/format-menu-nested.js +1 -5
- package/dist/esm/ui/format-menu-section.js +1 -4
- package/package.json +4 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-menu
|
|
2
2
|
|
|
3
|
+
## 5.0.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7583860e8637f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7583860e8637f) -
|
|
8
|
+
EDITOR-3621 Clean up platform_editor_block_menu_keyboard_navigation feature gate
|
|
9
|
+
- [`e3fe76664f63b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3fe76664f63b) -
|
|
10
|
+
Clean up platform_editor_block_menu_shouldfitcontainer
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 5.0.20
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`a26ad89b7926c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a26ad89b7926c) -
|
|
18
|
+
[ux] FG cleanup platform_editor_block_menu_for_disabled_nodes
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 5.0.19
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
"rootDir": "../",
|
|
7
7
|
"composite": true
|
|
8
8
|
},
|
|
9
|
-
"include": [
|
|
9
|
+
"include": [
|
|
10
|
+
"../src/**/*.ts",
|
|
11
|
+
"../src/**/*.tsx"
|
|
12
|
+
],
|
|
10
13
|
"exclude": [
|
|
11
14
|
"../src/**/__tests__/*",
|
|
12
15
|
"../src/**/*.test.*",
|
|
@@ -47,9 +50,6 @@
|
|
|
47
50
|
{
|
|
48
51
|
"path": "../../../design-system/icon/afm-cc/tsconfig.json"
|
|
49
52
|
},
|
|
50
|
-
{
|
|
51
|
-
"path": "../../../design-system/icon-lab/afm-cc/tsconfig.json"
|
|
52
|
-
},
|
|
53
53
|
{
|
|
54
54
|
"path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
|
|
55
55
|
},
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -9,9 +9,8 @@ exports.BlockMenuRenderer = void 0;
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
12
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
13
12
|
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); }
|
|
14
|
-
var NoOp = function NoOp(
|
|
13
|
+
var NoOp = function NoOp() {
|
|
15
14
|
return null;
|
|
16
15
|
};
|
|
17
16
|
var isNonNestedMenuSection = function isNonNestedMenuSection(component) {
|
|
@@ -99,7 +98,7 @@ var BlockMenuRenderer = exports.BlockMenuRenderer = function BlockMenuRenderer(_
|
|
|
99
98
|
}, children);
|
|
100
99
|
}));
|
|
101
100
|
};
|
|
102
|
-
return
|
|
101
|
+
return /*#__PURE__*/_react.default.createElement(_uiMenu.ArrowKeyNavigationProvider, {
|
|
103
102
|
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
104
|
-
}, renderMenu())
|
|
103
|
+
}, renderMenu());
|
|
105
104
|
};
|
|
@@ -139,7 +139,7 @@ var BlockMenuContent = function BlockMenuContent(_ref3) {
|
|
|
139
139
|
}));
|
|
140
140
|
};
|
|
141
141
|
var BlockMenu = function BlockMenu(_ref4) {
|
|
142
|
-
var _editorView$dom, _ref5
|
|
142
|
+
var _editorView$dom, _ref5;
|
|
143
143
|
var editorView = _ref4.editorView,
|
|
144
144
|
api = _ref4.api,
|
|
145
145
|
mountTo = _ref4.mountTo,
|
|
@@ -165,12 +165,12 @@ var BlockMenu = function BlockMenu(_ref4) {
|
|
|
165
165
|
var targetHandleRef = editorView === null || editorView === void 0 || (_editorView$dom = editorView.dom) === null || _editorView$dom === void 0 ? void 0 : _editorView$dom.querySelector(_styles.DRAG_HANDLE_SELECTOR);
|
|
166
166
|
var prevIsMenuOpenRef = (0, _react.useRef)(false);
|
|
167
167
|
var popupRef = (0, _react.useRef)(undefined);
|
|
168
|
-
var hasFocus = (
|
|
168
|
+
var hasFocus = (_ref5 = (editorView === null || editorView === void 0 ? void 0 : editorView.hasFocus()) || document.activeElement === targetHandleRef || popupRef.current && (popupRef.current.contains(document.activeElement) || popupRef.current === document.activeElement)) !== null && _ref5 !== void 0 ? _ref5 : false;
|
|
169
169
|
var hasSelection = !!editorView && !editorView.state.selection.empty;
|
|
170
170
|
// hasSelection true, always show block menu
|
|
171
171
|
// hasSelection false, only show block menu when empty line experiment is enabled
|
|
172
172
|
var shouldShowBlockMenuForEmptyLine = hasSelection || !hasSelection && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_empty_line', 'isEnabled', true);
|
|
173
|
-
var selectedByShortcutOrDragHandle = !!isSelectedViaDragHandle || !!openedViaKeyboard
|
|
173
|
+
var selectedByShortcutOrDragHandle = !!isSelectedViaDragHandle || !!openedViaKeyboard;
|
|
174
174
|
|
|
175
175
|
// Use conditional hook based on feature flag
|
|
176
176
|
useConditionalBlockMenuEffect({
|
|
@@ -237,7 +237,7 @@ var BlockMenu = function BlockMenu(_ref4) {
|
|
|
237
237
|
,
|
|
238
238
|
handleClickOutside: closeMenu,
|
|
239
239
|
handleEscapeKeydown: closeMenu,
|
|
240
|
-
handleBackspaceDeleteKeydown:
|
|
240
|
+
handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
|
|
241
241
|
mountTo: mountTo,
|
|
242
242
|
boundariesElement: boundariesElement,
|
|
243
243
|
scrollableElement: scrollableElement,
|
|
@@ -248,7 +248,7 @@ var BlockMenu = function BlockMenu(_ref4) {
|
|
|
248
248
|
preventOverflow: true // disables forced horizontal placement when forcePlacement is on, so fitWidth controls flipping
|
|
249
249
|
,
|
|
250
250
|
stick: true,
|
|
251
|
-
focusTrap:
|
|
251
|
+
focusTrap: openedViaKeyboard ?
|
|
252
252
|
// Only enable focus trap when opened via keyboard to make sure the focus is on the first focusable menu item
|
|
253
253
|
{
|
|
254
254
|
initialFocus: undefined
|
|
@@ -256,7 +256,7 @@ var BlockMenu = function BlockMenu(_ref4) {
|
|
|
256
256
|
offset: [_styles.DRAG_HANDLE_WIDTH + DRAG_HANDLE_OFFSET_PADDING, 0]
|
|
257
257
|
}, /*#__PURE__*/_react.default.createElement(BlockMenuContent, {
|
|
258
258
|
api: api,
|
|
259
|
-
setRef:
|
|
259
|
+
setRef: setRef
|
|
260
260
|
})));
|
|
261
261
|
} else {
|
|
262
262
|
return null;
|
|
@@ -11,13 +11,10 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
11
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
14
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
|
-
var _utils = require("@atlaskit/editor-tables/utils");
|
|
16
14
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
17
15
|
var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
18
16
|
var _box = require("@atlaskit/primitives/box");
|
|
19
17
|
var _text = _interopRequireDefault(require("@atlaskit/primitives/text"));
|
|
20
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
21
18
|
var _consts = require("./consts");
|
|
22
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); }
|
|
23
20
|
var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
@@ -26,7 +23,7 @@ var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
|
26
23
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
27
24
|
formatMessage = _useIntl.formatMessage;
|
|
28
25
|
var nodeTypes = Object.values((api === null || api === void 0 || (_api$core$sharedState = api.core.sharedState.currentState()) === null || _api$core$sharedState === void 0 || (_api$core$sharedState = _api$core$sharedState.schema) === null || _api$core$sharedState === void 0 ? void 0 : _api$core$sharedState.nodes) || {});
|
|
29
|
-
var onClick = function onClick(
|
|
26
|
+
var onClick = function onClick() {
|
|
30
27
|
api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
|
|
31
28
|
var _api$analytics, _api$blockControls;
|
|
32
29
|
var tr = _ref2.tr;
|
|
@@ -39,24 +36,7 @@ var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
|
39
36
|
eventType: _analytics.EVENT_TYPE.UI
|
|
40
37
|
};
|
|
41
38
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.attachAnalyticsEvent(payload)(tr);
|
|
42
|
-
|
|
43
|
-
(0, _selection.deleteSelectedRange)(tr);
|
|
44
|
-
} else {
|
|
45
|
-
var selection = tr.selection;
|
|
46
|
-
var from = selection.$from.pos;
|
|
47
|
-
var to = selection.$to.pos;
|
|
48
|
-
if (selection instanceof _state.TextSelection) {
|
|
49
|
-
from = from - 1;
|
|
50
|
-
to = to + 1;
|
|
51
|
-
} else if ((0, _utils.isTableSelected)(selection)) {
|
|
52
|
-
var table = (0, _utils.findTable)(selection);
|
|
53
|
-
if (table) {
|
|
54
|
-
from = table.pos;
|
|
55
|
-
to = table.pos + table.node.nodeSize;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
tr.deleteRange(from, to);
|
|
59
|
-
}
|
|
39
|
+
(0, _selection.deleteSelectedRange)(tr);
|
|
60
40
|
api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || (_api$blockControls = _api$blockControls.commands) === null || _api$blockControls === void 0 || _api$blockControls.toggleBlockMenu({
|
|
61
41
|
closeMenu: true
|
|
62
42
|
})({
|
|
@@ -90,13 +70,7 @@ var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
|
90
70
|
});
|
|
91
71
|
}, [api]);
|
|
92
72
|
(0, _react.useEffect)(function () {
|
|
93
|
-
if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true)) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
73
|
return function () {
|
|
97
|
-
if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true)) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
74
|
// clean up hover decoration when unmounting
|
|
101
75
|
onRemoveHoverDecoration();
|
|
102
76
|
};
|
|
@@ -104,8 +78,8 @@ var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
|
104
78
|
return /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
105
79
|
onMouseEnter: onShowHoverDecoration,
|
|
106
80
|
onMouseLeave: onRemoveHoverDecoration,
|
|
107
|
-
onFocus:
|
|
108
|
-
onBlur:
|
|
81
|
+
onFocus: onShowHoverDecoration,
|
|
82
|
+
onBlur: onRemoveHoverDecoration
|
|
109
83
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
110
84
|
elemBefore: /*#__PURE__*/_react.default.createElement(_delete.default, {
|
|
111
85
|
color: "var(--ds-icon-danger, #C9372C)",
|
|
@@ -13,16 +13,13 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
13
13
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
14
14
|
var _changes = _interopRequireDefault(require("@atlaskit/icon/core/changes"));
|
|
15
15
|
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
|
|
16
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _consts = require("./consts");
|
|
18
|
-
var _checkIsFormatMenuHidden = require("./utils/checkIsFormatMenuHidden");
|
|
19
17
|
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
18
|
var FormatMenuComponent = exports.FormatMenuComponent = function FormatMenuComponent(_ref) {
|
|
21
19
|
var api = _ref.api,
|
|
22
20
|
children = _ref.children;
|
|
23
21
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
24
22
|
formatMessage = _useIntl.formatMessage;
|
|
25
|
-
var isDisabled = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_for_disabled_nodes') ? (0, _checkIsFormatMenuHidden.checkIsFormatMenuHidden)(api) : false;
|
|
26
23
|
var handleClick = (0, _react.useCallback)(function () {
|
|
27
24
|
api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
|
|
28
25
|
var _api$analytics;
|
|
@@ -48,9 +45,8 @@ var FormatMenuComponent = exports.FormatMenuComponent = function FormatMenuCompo
|
|
|
48
45
|
label: ""
|
|
49
46
|
}),
|
|
50
47
|
enableMaxHeight: true,
|
|
51
|
-
isDisabled: isDisabled,
|
|
52
48
|
onClick: handleClick,
|
|
53
49
|
dropdownTestId: "editor-nested-turn-into-menu",
|
|
54
|
-
shouldFitContainer:
|
|
50
|
+
shouldFitContainer: true
|
|
55
51
|
}, children);
|
|
56
52
|
};
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.FormatMenuSection = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var _checkIsFormatMenuHidden = require("./utils/checkIsFormatMenuHidden");
|
|
12
11
|
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); }
|
|
13
12
|
var FormatMenuSection = exports.FormatMenuSection = function FormatMenuSection(_ref) {
|
|
@@ -16,9 +15,7 @@ var FormatMenuSection = exports.FormatMenuSection = function FormatMenuSection(_
|
|
|
16
15
|
var isFormatMenuHidden = (0, _react.useCallback)(function () {
|
|
17
16
|
return (0, _checkIsFormatMenuHidden.checkIsFormatMenuHidden)(api);
|
|
18
17
|
}, [api]);
|
|
19
|
-
|
|
20
|
-
// When platform_editor_block_menu_for_disabled_nodes feature flag is OFF, use the original behavior (hide the menu)
|
|
21
|
-
if (isFormatMenuHidden() && !(0, _platformFeatureFlags.fg)('platform_editor_block_menu_for_disabled_nodes')) {
|
|
18
|
+
if (isFormatMenuHidden()) {
|
|
22
19
|
return null;
|
|
23
20
|
}
|
|
24
21
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, null, children);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
3
|
-
|
|
4
|
-
const NoOp = props => null;
|
|
3
|
+
const NoOp = () => null;
|
|
5
4
|
const isNonNestedMenuSection = component => {
|
|
6
5
|
return component.type === 'block-menu-section' && !('parent' in component);
|
|
7
6
|
};
|
|
@@ -78,7 +77,7 @@ export const BlockMenuRenderer = ({
|
|
|
78
77
|
}, children);
|
|
79
78
|
}));
|
|
80
79
|
};
|
|
81
|
-
return
|
|
80
|
+
return /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
82
81
|
type: ArrowKeyNavigationType.MENU
|
|
83
|
-
}, renderMenu())
|
|
82
|
+
}, renderMenu());
|
|
84
83
|
};
|
|
@@ -132,7 +132,7 @@ const BlockMenu = ({
|
|
|
132
132
|
boundariesElement,
|
|
133
133
|
scrollableElement
|
|
134
134
|
}) => {
|
|
135
|
-
var _editorView$dom, _ref
|
|
135
|
+
var _editorView$dom, _ref;
|
|
136
136
|
const {
|
|
137
137
|
menuTriggerBy,
|
|
138
138
|
isSelectedViaDragHandle,
|
|
@@ -155,12 +155,12 @@ const BlockMenu = ({
|
|
|
155
155
|
const targetHandleRef = editorView === null || editorView === void 0 ? void 0 : (_editorView$dom = editorView.dom) === null || _editorView$dom === void 0 ? void 0 : _editorView$dom.querySelector(DRAG_HANDLE_SELECTOR);
|
|
156
156
|
const prevIsMenuOpenRef = useRef(false);
|
|
157
157
|
const popupRef = useRef(undefined);
|
|
158
|
-
const hasFocus =
|
|
158
|
+
const hasFocus = (_ref = (editorView === null || editorView === void 0 ? void 0 : editorView.hasFocus()) || document.activeElement === targetHandleRef || popupRef.current && (popupRef.current.contains(document.activeElement) || popupRef.current === document.activeElement)) !== null && _ref !== void 0 ? _ref : false;
|
|
159
159
|
const hasSelection = !!editorView && !editorView.state.selection.empty;
|
|
160
160
|
// hasSelection true, always show block menu
|
|
161
161
|
// hasSelection false, only show block menu when empty line experiment is enabled
|
|
162
162
|
const shouldShowBlockMenuForEmptyLine = hasSelection || !hasSelection && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true);
|
|
163
|
-
const selectedByShortcutOrDragHandle = !!isSelectedViaDragHandle || !!openedViaKeyboard
|
|
163
|
+
const selectedByShortcutOrDragHandle = !!isSelectedViaDragHandle || !!openedViaKeyboard;
|
|
164
164
|
|
|
165
165
|
// Use conditional hook based on feature flag
|
|
166
166
|
useConditionalBlockMenuEffect({
|
|
@@ -229,7 +229,7 @@ const BlockMenu = ({
|
|
|
229
229
|
,
|
|
230
230
|
handleClickOutside: closeMenu,
|
|
231
231
|
handleEscapeKeydown: closeMenu,
|
|
232
|
-
handleBackspaceDeleteKeydown:
|
|
232
|
+
handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
|
|
233
233
|
mountTo: mountTo,
|
|
234
234
|
boundariesElement: boundariesElement,
|
|
235
235
|
scrollableElement: scrollableElement,
|
|
@@ -240,7 +240,7 @@ const BlockMenu = ({
|
|
|
240
240
|
preventOverflow: true // disables forced horizontal placement when forcePlacement is on, so fitWidth controls flipping
|
|
241
241
|
,
|
|
242
242
|
stick: true,
|
|
243
|
-
focusTrap:
|
|
243
|
+
focusTrap: openedViaKeyboard ?
|
|
244
244
|
// Only enable focus trap when opened via keyboard to make sure the focus is on the first focusable menu item
|
|
245
245
|
{
|
|
246
246
|
initialFocus: undefined
|
|
@@ -248,7 +248,7 @@ const BlockMenu = ({
|
|
|
248
248
|
offset: [DRAG_HANDLE_WIDTH + DRAG_HANDLE_OFFSET_PADDING, 0]
|
|
249
249
|
}, /*#__PURE__*/React.createElement(BlockMenuContent, {
|
|
250
250
|
api: api,
|
|
251
|
-
setRef:
|
|
251
|
+
setRef: setRef
|
|
252
252
|
})));
|
|
253
253
|
} else {
|
|
254
254
|
return null;
|
|
@@ -3,13 +3,10 @@ import { useIntl, injectIntl } from 'react-intl-next';
|
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { deleteSelectedRange } from '@atlaskit/editor-common/selection';
|
|
6
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
8
6
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
9
7
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
10
8
|
import { Box } from '@atlaskit/primitives/box';
|
|
11
9
|
import Text from '@atlaskit/primitives/text';
|
|
12
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
13
10
|
import { BLOCK_MENU_ITEM_NAME } from './consts';
|
|
14
11
|
const DeleteDropdownItemContent = ({
|
|
15
12
|
api
|
|
@@ -19,7 +16,7 @@ const DeleteDropdownItemContent = ({
|
|
|
19
16
|
formatMessage
|
|
20
17
|
} = useIntl();
|
|
21
18
|
const nodeTypes = Object.values((api === null || api === void 0 ? void 0 : (_api$core$sharedState = api.core.sharedState.currentState()) === null || _api$core$sharedState === void 0 ? void 0 : (_api$core$sharedState2 = _api$core$sharedState.schema) === null || _api$core$sharedState2 === void 0 ? void 0 : _api$core$sharedState2.nodes) || {});
|
|
22
|
-
const onClick =
|
|
19
|
+
const onClick = () => {
|
|
23
20
|
api === null || api === void 0 ? void 0 : api.core.actions.execute(({
|
|
24
21
|
tr
|
|
25
22
|
}) => {
|
|
@@ -33,24 +30,7 @@ const DeleteDropdownItemContent = ({
|
|
|
33
30
|
eventType: EVENT_TYPE.UI
|
|
34
31
|
};
|
|
35
32
|
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.attachAnalyticsEvent(payload)(tr);
|
|
36
|
-
|
|
37
|
-
deleteSelectedRange(tr);
|
|
38
|
-
} else {
|
|
39
|
-
const selection = tr.selection;
|
|
40
|
-
let from = selection.$from.pos;
|
|
41
|
-
let to = selection.$to.pos;
|
|
42
|
-
if (selection instanceof TextSelection) {
|
|
43
|
-
from = from - 1;
|
|
44
|
-
to = to + 1;
|
|
45
|
-
} else if (isTableSelected(selection)) {
|
|
46
|
-
const table = findTable(selection);
|
|
47
|
-
if (table) {
|
|
48
|
-
from = table.pos;
|
|
49
|
-
to = table.pos + table.node.nodeSize;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
tr.deleteRange(from, to);
|
|
53
|
-
}
|
|
33
|
+
deleteSelectedRange(tr);
|
|
54
34
|
api === null || api === void 0 ? void 0 : (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : (_api$blockControls$co = _api$blockControls.commands) === null || _api$blockControls$co === void 0 ? void 0 : _api$blockControls$co.toggleBlockMenu({
|
|
55
35
|
closeMenu: true
|
|
56
36
|
})({
|
|
@@ -86,13 +66,7 @@ const DeleteDropdownItemContent = ({
|
|
|
86
66
|
});
|
|
87
67
|
}, [api]);
|
|
88
68
|
useEffect(() => {
|
|
89
|
-
if (!expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true)) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
69
|
return () => {
|
|
93
|
-
if (!expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true)) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
70
|
// clean up hover decoration when unmounting
|
|
97
71
|
onRemoveHoverDecoration();
|
|
98
72
|
};
|
|
@@ -100,8 +74,8 @@ const DeleteDropdownItemContent = ({
|
|
|
100
74
|
return /*#__PURE__*/React.createElement(Box, {
|
|
101
75
|
onMouseEnter: onShowHoverDecoration,
|
|
102
76
|
onMouseLeave: onRemoveHoverDecoration,
|
|
103
|
-
onFocus:
|
|
104
|
-
onBlur:
|
|
77
|
+
onFocus: onShowHoverDecoration,
|
|
78
|
+
onBlur: onRemoveHoverDecoration
|
|
105
79
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
106
80
|
elemBefore: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
107
81
|
color: "var(--ds-icon-danger, #C9372C)",
|
|
@@ -5,9 +5,7 @@ import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
|
5
5
|
import { ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
6
6
|
import ChangesIcon from '@atlaskit/icon/core/changes';
|
|
7
7
|
import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { BLOCK_MENU_ITEM_NAME } from './consts';
|
|
10
|
-
import { checkIsFormatMenuHidden } from './utils/checkIsFormatMenuHidden';
|
|
11
9
|
export const FormatMenuComponent = ({
|
|
12
10
|
api,
|
|
13
11
|
children
|
|
@@ -15,7 +13,6 @@ export const FormatMenuComponent = ({
|
|
|
15
13
|
const {
|
|
16
14
|
formatMessage
|
|
17
15
|
} = useIntl();
|
|
18
|
-
const isDisabled = fg('platform_editor_block_menu_for_disabled_nodes') ? checkIsFormatMenuHidden(api) : false;
|
|
19
16
|
const handleClick = useCallback(() => {
|
|
20
17
|
api === null || api === void 0 ? void 0 : api.core.actions.execute(({
|
|
21
18
|
tr
|
|
@@ -42,9 +39,8 @@ export const FormatMenuComponent = ({
|
|
|
42
39
|
label: ""
|
|
43
40
|
}),
|
|
44
41
|
enableMaxHeight: true,
|
|
45
|
-
isDisabled: isDisabled,
|
|
46
42
|
onClick: handleClick,
|
|
47
43
|
dropdownTestId: "editor-nested-turn-into-menu",
|
|
48
|
-
shouldFitContainer:
|
|
44
|
+
shouldFitContainer: true
|
|
49
45
|
}, children);
|
|
50
46
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { checkIsFormatMenuHidden } from './utils/checkIsFormatMenuHidden';
|
|
5
4
|
export const FormatMenuSection = ({
|
|
6
5
|
children,
|
|
@@ -9,9 +8,7 @@ export const FormatMenuSection = ({
|
|
|
9
8
|
const isFormatMenuHidden = useCallback(() => {
|
|
10
9
|
return checkIsFormatMenuHidden(api);
|
|
11
10
|
}, [api]);
|
|
12
|
-
|
|
13
|
-
// When platform_editor_block_menu_for_disabled_nodes feature flag is OFF, use the original behavior (hide the menu)
|
|
14
|
-
if (isFormatMenuHidden() && !fg('platform_editor_block_menu_for_disabled_nodes')) {
|
|
11
|
+
if (isFormatMenuHidden()) {
|
|
15
12
|
return null;
|
|
16
13
|
}
|
|
17
14
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, children);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import React, { Fragment } from 'react';
|
|
3
3
|
import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
4
|
-
|
|
5
|
-
var NoOp = function NoOp(props) {
|
|
4
|
+
var NoOp = function NoOp() {
|
|
6
5
|
return null;
|
|
7
6
|
};
|
|
8
7
|
var isNonNestedMenuSection = function isNonNestedMenuSection(component) {
|
|
@@ -90,7 +89,7 @@ export var BlockMenuRenderer = function BlockMenuRenderer(_ref) {
|
|
|
90
89
|
}, children);
|
|
91
90
|
}));
|
|
92
91
|
};
|
|
93
|
-
return
|
|
92
|
+
return /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
94
93
|
type: ArrowKeyNavigationType.MENU
|
|
95
|
-
}, renderMenu())
|
|
94
|
+
}, renderMenu());
|
|
96
95
|
};
|
|
@@ -131,7 +131,7 @@ var BlockMenuContent = function BlockMenuContent(_ref3) {
|
|
|
131
131
|
}));
|
|
132
132
|
};
|
|
133
133
|
var BlockMenu = function BlockMenu(_ref4) {
|
|
134
|
-
var _editorView$dom, _ref5
|
|
134
|
+
var _editorView$dom, _ref5;
|
|
135
135
|
var editorView = _ref4.editorView,
|
|
136
136
|
api = _ref4.api,
|
|
137
137
|
mountTo = _ref4.mountTo,
|
|
@@ -157,12 +157,12 @@ var BlockMenu = function BlockMenu(_ref4) {
|
|
|
157
157
|
var targetHandleRef = editorView === null || editorView === void 0 || (_editorView$dom = editorView.dom) === null || _editorView$dom === void 0 ? void 0 : _editorView$dom.querySelector(DRAG_HANDLE_SELECTOR);
|
|
158
158
|
var prevIsMenuOpenRef = useRef(false);
|
|
159
159
|
var popupRef = useRef(undefined);
|
|
160
|
-
var hasFocus =
|
|
160
|
+
var hasFocus = (_ref5 = (editorView === null || editorView === void 0 ? void 0 : editorView.hasFocus()) || document.activeElement === targetHandleRef || popupRef.current && (popupRef.current.contains(document.activeElement) || popupRef.current === document.activeElement)) !== null && _ref5 !== void 0 ? _ref5 : false;
|
|
161
161
|
var hasSelection = !!editorView && !editorView.state.selection.empty;
|
|
162
162
|
// hasSelection true, always show block menu
|
|
163
163
|
// hasSelection false, only show block menu when empty line experiment is enabled
|
|
164
164
|
var shouldShowBlockMenuForEmptyLine = hasSelection || !hasSelection && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true);
|
|
165
|
-
var selectedByShortcutOrDragHandle = !!isSelectedViaDragHandle || !!openedViaKeyboard
|
|
165
|
+
var selectedByShortcutOrDragHandle = !!isSelectedViaDragHandle || !!openedViaKeyboard;
|
|
166
166
|
|
|
167
167
|
// Use conditional hook based on feature flag
|
|
168
168
|
useConditionalBlockMenuEffect({
|
|
@@ -229,7 +229,7 @@ var BlockMenu = function BlockMenu(_ref4) {
|
|
|
229
229
|
,
|
|
230
230
|
handleClickOutside: closeMenu,
|
|
231
231
|
handleEscapeKeydown: closeMenu,
|
|
232
|
-
handleBackspaceDeleteKeydown:
|
|
232
|
+
handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
|
|
233
233
|
mountTo: mountTo,
|
|
234
234
|
boundariesElement: boundariesElement,
|
|
235
235
|
scrollableElement: scrollableElement,
|
|
@@ -240,7 +240,7 @@ var BlockMenu = function BlockMenu(_ref4) {
|
|
|
240
240
|
preventOverflow: true // disables forced horizontal placement when forcePlacement is on, so fitWidth controls flipping
|
|
241
241
|
,
|
|
242
242
|
stick: true,
|
|
243
|
-
focusTrap:
|
|
243
|
+
focusTrap: openedViaKeyboard ?
|
|
244
244
|
// Only enable focus trap when opened via keyboard to make sure the focus is on the first focusable menu item
|
|
245
245
|
{
|
|
246
246
|
initialFocus: undefined
|
|
@@ -248,7 +248,7 @@ var BlockMenu = function BlockMenu(_ref4) {
|
|
|
248
248
|
offset: [DRAG_HANDLE_WIDTH + DRAG_HANDLE_OFFSET_PADDING, 0]
|
|
249
249
|
}, /*#__PURE__*/React.createElement(BlockMenuContent, {
|
|
250
250
|
api: api,
|
|
251
|
-
setRef:
|
|
251
|
+
setRef: setRef
|
|
252
252
|
})));
|
|
253
253
|
} else {
|
|
254
254
|
return null;
|
|
@@ -3,13 +3,10 @@ import { useIntl, injectIntl } from 'react-intl-next';
|
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { deleteSelectedRange } from '@atlaskit/editor-common/selection';
|
|
6
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
8
6
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
9
7
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
10
8
|
import { Box } from '@atlaskit/primitives/box';
|
|
11
9
|
import Text from '@atlaskit/primitives/text';
|
|
12
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
13
10
|
import { BLOCK_MENU_ITEM_NAME } from './consts';
|
|
14
11
|
var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
15
12
|
var _api$core$sharedState;
|
|
@@ -17,7 +14,7 @@ var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
|
17
14
|
var _useIntl = useIntl(),
|
|
18
15
|
formatMessage = _useIntl.formatMessage;
|
|
19
16
|
var nodeTypes = Object.values((api === null || api === void 0 || (_api$core$sharedState = api.core.sharedState.currentState()) === null || _api$core$sharedState === void 0 || (_api$core$sharedState = _api$core$sharedState.schema) === null || _api$core$sharedState === void 0 ? void 0 : _api$core$sharedState.nodes) || {});
|
|
20
|
-
var onClick = function onClick(
|
|
17
|
+
var onClick = function onClick() {
|
|
21
18
|
api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
|
|
22
19
|
var _api$analytics, _api$blockControls;
|
|
23
20
|
var tr = _ref2.tr;
|
|
@@ -30,24 +27,7 @@ var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
|
30
27
|
eventType: EVENT_TYPE.UI
|
|
31
28
|
};
|
|
32
29
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.attachAnalyticsEvent(payload)(tr);
|
|
33
|
-
|
|
34
|
-
deleteSelectedRange(tr);
|
|
35
|
-
} else {
|
|
36
|
-
var selection = tr.selection;
|
|
37
|
-
var from = selection.$from.pos;
|
|
38
|
-
var to = selection.$to.pos;
|
|
39
|
-
if (selection instanceof TextSelection) {
|
|
40
|
-
from = from - 1;
|
|
41
|
-
to = to + 1;
|
|
42
|
-
} else if (isTableSelected(selection)) {
|
|
43
|
-
var table = findTable(selection);
|
|
44
|
-
if (table) {
|
|
45
|
-
from = table.pos;
|
|
46
|
-
to = table.pos + table.node.nodeSize;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
tr.deleteRange(from, to);
|
|
50
|
-
}
|
|
30
|
+
deleteSelectedRange(tr);
|
|
51
31
|
api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || (_api$blockControls = _api$blockControls.commands) === null || _api$blockControls === void 0 || _api$blockControls.toggleBlockMenu({
|
|
52
32
|
closeMenu: true
|
|
53
33
|
})({
|
|
@@ -81,13 +61,7 @@ var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
|
81
61
|
});
|
|
82
62
|
}, [api]);
|
|
83
63
|
useEffect(function () {
|
|
84
|
-
if (!expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true)) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
64
|
return function () {
|
|
88
|
-
if (!expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true)) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
65
|
// clean up hover decoration when unmounting
|
|
92
66
|
onRemoveHoverDecoration();
|
|
93
67
|
};
|
|
@@ -95,8 +69,8 @@ var DeleteDropdownItemContent = function DeleteDropdownItemContent(_ref) {
|
|
|
95
69
|
return /*#__PURE__*/React.createElement(Box, {
|
|
96
70
|
onMouseEnter: onShowHoverDecoration,
|
|
97
71
|
onMouseLeave: onRemoveHoverDecoration,
|
|
98
|
-
onFocus:
|
|
99
|
-
onBlur:
|
|
72
|
+
onFocus: onShowHoverDecoration,
|
|
73
|
+
onBlur: onRemoveHoverDecoration
|
|
100
74
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
101
75
|
elemBefore: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
102
76
|
color: "var(--ds-icon-danger, #C9372C)",
|
|
@@ -5,15 +5,12 @@ import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
|
5
5
|
import { ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
6
6
|
import ChangesIcon from '@atlaskit/icon/core/changes';
|
|
7
7
|
import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { BLOCK_MENU_ITEM_NAME } from './consts';
|
|
10
|
-
import { checkIsFormatMenuHidden } from './utils/checkIsFormatMenuHidden';
|
|
11
9
|
export var FormatMenuComponent = function FormatMenuComponent(_ref) {
|
|
12
10
|
var api = _ref.api,
|
|
13
11
|
children = _ref.children;
|
|
14
12
|
var _useIntl = useIntl(),
|
|
15
13
|
formatMessage = _useIntl.formatMessage;
|
|
16
|
-
var isDisabled = fg('platform_editor_block_menu_for_disabled_nodes') ? checkIsFormatMenuHidden(api) : false;
|
|
17
14
|
var handleClick = useCallback(function () {
|
|
18
15
|
api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
|
|
19
16
|
var _api$analytics;
|
|
@@ -39,9 +36,8 @@ export var FormatMenuComponent = function FormatMenuComponent(_ref) {
|
|
|
39
36
|
label: ""
|
|
40
37
|
}),
|
|
41
38
|
enableMaxHeight: true,
|
|
42
|
-
isDisabled: isDisabled,
|
|
43
39
|
onClick: handleClick,
|
|
44
40
|
dropdownTestId: "editor-nested-turn-into-menu",
|
|
45
|
-
shouldFitContainer:
|
|
41
|
+
shouldFitContainer: true
|
|
46
42
|
}, children);
|
|
47
43
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { checkIsFormatMenuHidden } from './utils/checkIsFormatMenuHidden';
|
|
5
4
|
export var FormatMenuSection = function FormatMenuSection(_ref) {
|
|
6
5
|
var children = _ref.children,
|
|
@@ -8,9 +7,7 @@ export var FormatMenuSection = function FormatMenuSection(_ref) {
|
|
|
8
7
|
var isFormatMenuHidden = useCallback(function () {
|
|
9
8
|
return checkIsFormatMenuHidden(api);
|
|
10
9
|
}, [api]);
|
|
11
|
-
|
|
12
|
-
// When platform_editor_block_menu_for_disabled_nodes feature flag is OFF, use the original behavior (hide the menu)
|
|
13
|
-
if (isFormatMenuHidden() && !fg('platform_editor_block_menu_for_disabled_nodes')) {
|
|
10
|
+
if (isFormatMenuHidden()) {
|
|
14
11
|
return null;
|
|
15
12
|
}
|
|
16
13
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, children);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.21",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/css": "^0.17.0",
|
|
32
32
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
34
|
-
"@atlaskit/editor-plugin-block-controls": "^7.
|
|
34
|
+
"@atlaskit/editor-plugin-block-controls": "^7.10.0",
|
|
35
35
|
"@atlaskit/editor-plugin-decorations": "^6.1.0",
|
|
36
36
|
"@atlaskit/editor-plugin-selection": "^6.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-user-intent": "^4.0.0",
|
|
@@ -40,16 +40,15 @@
|
|
|
40
40
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
41
41
|
"@atlaskit/editor-toolbar": "^0.17.0",
|
|
42
42
|
"@atlaskit/icon": "^29.0.0",
|
|
43
|
-
"@atlaskit/icon-lab": "^5.12.0",
|
|
44
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
44
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
46
45
|
"@atlaskit/primitives": "^16.4.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^14.1.0",
|
|
48
47
|
"@atlaskit/tokens": "^8.4.0",
|
|
49
48
|
"@babel/runtime": "^7.0.0"
|
|
50
49
|
},
|
|
51
50
|
"peerDependencies": {
|
|
52
|
-
"@atlaskit/editor-common": "^110.
|
|
51
|
+
"@atlaskit/editor-common": "^110.36.0",
|
|
53
52
|
"react": "^18.2.0",
|
|
54
53
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
55
54
|
},
|
|
@@ -96,12 +95,6 @@
|
|
|
96
95
|
"platform_editor_block_menu_transform_nested_node": {
|
|
97
96
|
"type": "boolean"
|
|
98
97
|
},
|
|
99
|
-
"platform_editor_block_menu_for_disabled_nodes": {
|
|
100
|
-
"type": "boolean"
|
|
101
|
-
},
|
|
102
|
-
"platform_editor_block_menu_shouldfitcontainer": {
|
|
103
|
-
"type": "boolean"
|
|
104
|
-
},
|
|
105
98
|
"platform_editor_toolbar_aifc_user_intent_fix": {
|
|
106
99
|
"type": "boolean"
|
|
107
100
|
}
|