UNPKG

@microsoft/sp-webpart-base

Version:

SharePoint Framework support for building web parts

94 lines 5.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isServerPropertiesSanitizedEnabled = exports.isBotAcesFromTeamsEnabled = exports.isConfigurationToolsEnabled = exports.shouldShowGraphMetadataInErrorMessage = exports.shouldUseListWebPartFileBrowser = exports.shouldUseListWebPartV2 = exports.shouldUseImageWebPartV2 = exports.isImageRefactorExpEnabled = exports.isImageRefactorFlightEnabled = exports.isBotDrivenACEEnabled = exports.isIsolatedAdaptiveCardExtensionWebEnabled = exports.isWEXWebPartOnDisposePromiseChainEnabled = exports.isWebPartAudienceTargetingEnabled = exports.isOptionalSupportedHostsFilteringEnabled = exports.is1PIsolationEnabled = exports.isIsolatedAceEnabled = void 0; var sp_core_library_1 = require("@microsoft/sp-core-library"); var sp_telemetry_1 = require("@ms/sp-telemetry"); var KillSwitches_1 = require("./KillSwitches"); function isIsolatedAceEnabled() { var isSafari = navigator.userAgent.indexOf('Chrome') === -1 && navigator.userAgent.indexOf('Safari') > -1; return (sp_core_library_1._SPFlight.isEnabled(60290 /* SPPPlatIsolatedAce */) && (!isSafari || sp_core_library_1._SPFlight.isEnabled(60524 /* SPPPlatSafariBridgeIsolation */))); } exports.isIsolatedAceEnabled = isIsolatedAceEnabled; function is1PIsolationEnabled() { return sp_core_library_1._SPFlight.isEnabled(60400 /* SPPPlatFirstPartyIsolation */); } exports.is1PIsolationEnabled = is1PIsolationEnabled; function isOptionalSupportedHostsFilteringEnabled() { return sp_core_library_1._SPFlight.isEnabled(60079 /* OptionalSupportedHostsFiltering */); } exports.isOptionalSupportedHostsFilteringEnabled = isOptionalSupportedHostsFilteringEnabled; function isWebPartAudienceTargetingEnabled() { return sp_core_library_1._SPFlight.isEnabled(60668 /* WexWebPartAudienceTargeting */); } exports.isWebPartAudienceTargetingEnabled = isWebPartAudienceTargetingEnabled; function isWEXWebPartOnDisposePromiseChainEnabled() { return sp_core_library_1._SPFlight.isEnabled(60759 /* WEXWebPartOnDisposePromiseChain */); } exports.isWEXWebPartOnDisposePromiseChainEnabled = isWEXWebPartOnDisposePromiseChainEnabled; function isIsolatedAdaptiveCardExtensionWebEnabled() { return ((!sp_core_library_1._BrowserUtilities.isSafari() || (0, KillSwitches_1.isSafariIsolationKSActivated)()) && ((!(0, KillSwitches_1.isUberIsolatedACEFlightKSActivated)() && sp_core_library_1._SPFlight.isEnabled(60622 /* IsolatedAdaptiveCardExtensionWeb */)) || sp_core_library_1._SPFlight.isEnabled(60821 /* APEXIsolatedACEWEB1 */) || sp_core_library_1._SPFlight.isEnabled(60822 /* APEXIsolatedACEWEB2 */) || sp_core_library_1._SPFlight.isEnabled(60823 /* APEXIsolatedACEWEB3 */) || sp_core_library_1._SPFlight.isEnabled(60824 /* APEXIsolatedACEWEB4 */) || shouldShowIsolatedCardsOnTeams())); } exports.isIsolatedAdaptiveCardExtensionWebEnabled = isIsolatedAdaptiveCardExtensionWebEnabled; function shouldShowIsolatedCardsOnTeams() { if (!(0, KillSwitches_1.isAlwaysShowIsolatedACEOnTeamsKSActive)()) { // this flight won't pass prodbubble return sp_core_library_1._SPFlight.isEnabled(1252 /* VivaHomeIsolatedDomainCards */) && sp_core_library_1._BrowserUtilities.isTeamsHosted(); } else { return (!(0, KillSwitches_1.isVivaHomeIsolatedAceCheckKSActive)() && sp_core_library_1._SPFlight.isEnabled(1252 /* VivaHomeIsolatedDomainCards */) && sp_core_library_1._BrowserUtilities.isFromVivaHome()); } } function isBotDrivenACEEnabled() { return sp_core_library_1._SPFlight.isEnabled(60353 /* APEXBotDrivenAce */); } exports.isBotDrivenACEEnabled = isBotDrivenACEEnabled; function isImageRefactorFlightEnabled() { return sp_core_library_1._SPFlight.isEnabled(1967 /* WEXImageWebPartRefactor */); } exports.isImageRefactorFlightEnabled = isImageRefactorFlightEnabled; function isImageRefactorExpEnabled() { return (sp_telemetry_1._SPPerfExperiment.getVariantAndTrackExperiment(sp_telemetry_1._PerformanceExperiment.WEXImageWebPartRefactorExp) === 1); } exports.isImageRefactorExpEnabled = isImageRefactorExpEnabled; function shouldUseImageWebPartV2() { return !(0, KillSwitches_1.isImageRefactorKSActivated)() && (isImageRefactorFlightEnabled() || isImageRefactorExpEnabled()); } exports.shouldUseImageWebPartV2 = shouldUseImageWebPartV2; function shouldUseListWebPartV2() { return sp_core_library_1._SPFlight.isEnabled(61149 /* ListsWebPartSpartan */); } exports.shouldUseListWebPartV2 = shouldUseListWebPartV2; function shouldUseListWebPartFileBrowser() { return sp_core_library_1._SPFlight.isEnabled(22854 /* EnableFileBrowserWebPart */); } exports.shouldUseListWebPartFileBrowser = shouldUseListWebPartFileBrowser; function shouldShowGraphMetadataInErrorMessage() { return sp_core_library_1._SPFlight.isEnabled(61319 /* DisplayErrorMessageWithGraphMetadata */); } exports.shouldShowGraphMetadataInErrorMessage = shouldShowGraphMetadataInErrorMessage; // cross-project flight function isConfigurationToolsEnabled() { return sp_core_library_1._SPFlight.isEnabled(60808 /* ContentPanel */) && sp_core_library_1._SPFlight.isEnabled(1599 /* ConfigurationTools */); } exports.isConfigurationToolsEnabled = isConfigurationToolsEnabled; // cross-project flight function isBotAcesFromTeamsEnabled() { return sp_core_library_1._SPFlight.isEnabled(60693 /* APEXBotAceFromTeamsClient */); } exports.isBotAcesFromTeamsEnabled = isBotAcesFromTeamsEnabled; // cross-project flight function isServerPropertiesSanitizedEnabled() { return sp_core_library_1._SPFlight.isEnabled(61389 /* APEXServerPropertiesSanitizedEnabled */); } exports.isServerPropertiesSanitizedEnabled = isServerPropertiesSanitizedEnabled; //# sourceMappingURL=Flights.js.map