UNPKG

@atlaskit/editor-plugin-block-menu

Version:

BlockMenu plugin for @atlaskit/editor-core

23 lines (22 loc) • 888 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isCopyLinkEnabled = void 0; var _fg = require("@atlaskit/platform-feature-flags/fg"); /** * Whether the "Copy link" block menu item and its keyboard shortcut are available. * * Copy link only works when blocks have localIds, so it is opt-in per editor preset via * `enableCopyLinkToSelection`. While `platform_editor_block_menu_copy_link_opt_in` is off, the previous * behaviour is kept and `enableCopyLinkToSelection` is ignored. */ var isCopyLinkEnabled = exports.isCopyLinkEnabled = function isCopyLinkEnabled(config) { if (!(0, _fg.fg)('platform_editor_adf_with_localid')) { return false; } if ((0, _fg.fg)('platform_editor_block_menu_copy_link_opt_in')) { return Boolean(config === null || config === void 0 ? void 0 : config.enableCopyLinkToSelection); } return true; };