@atlaskit/editor-plugin-block-controls
Version:
Block controls plugin for @atlaskit/editor-core
24 lines (23 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.shouldUseNestedDragHandleIcon = void 0;
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
// Nested icon for non-top-level nodes when the experiment is on. Exception: with the
// kill switch OFF, layout columns use the full block handle instead.
// TODO: EDITOR-7732 - remove this whole function when
// `platform_editor_layout_column_menu_kill_switch_1` is cleaned up
var shouldUseNestedDragHandleIcon = exports.shouldUseNestedDragHandleIcon = function shouldUseNestedDragHandleIcon(isTopLevelNode, isLayoutColumn) {
if (!(0, _expValEquals.expValEquals)('platform_editor_nested_drag_handle_icon', 'isEnabled', true)) {
return false;
}
if (isTopLevelNode) {
return false;
}
if (isLayoutColumn && !(0, _platformFeatureFlags.fg)('platform_editor_layout_column_menu_kill_switch_1')) {
return false;
}
return true;
};