1"use strict"; 2 3Object.defineProperty(exports, "__esModule", { 4 value: true 5}); 6exports.PORTRAIT_ORIENTATIONS = exports.LANDSCAPE_ORIENTATIONS = void 0; 7exports.getOrientation = getOrientation; 8exports.setOrientation = setOrientation; 9exports.withOrientation = void 0; 10 11function _iosPlugins() { 12 const data = require("../plugins/ios-plugins"); 13 14 _iosPlugins = function () { 15 return data; 16 }; 17 18 return data; 19} 20 21const withOrientation = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setOrientation, { 22 infoPlistProperty: 'UISupportedInterfaceOrientations', 23 expoConfigProperty: 'orientation' 24}, 'withOrientation'); 25exports.withOrientation = withOrientation; 26 27function getOrientation(config) { 28 var _config$orientation; 29 30 return (_config$orientation = config.orientation) !== null && _config$orientation !== void 0 ? _config$orientation : null; 31} 32 33const PORTRAIT_ORIENTATIONS = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown']; 34exports.PORTRAIT_ORIENTATIONS = PORTRAIT_ORIENTATIONS; 35const LANDSCAPE_ORIENTATIONS = ['UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight']; 36exports.LANDSCAPE_ORIENTATIONS = LANDSCAPE_ORIENTATIONS; 37 38function getUISupportedInterfaceOrientations(orientation) { 39 if (orientation === 'portrait') { 40 return PORTRAIT_ORIENTATIONS; 41 } else if (orientation === 'landscape') { 42 return LANDSCAPE_ORIENTATIONS; 43 } else { 44 return [...PORTRAIT_ORIENTATIONS, ...LANDSCAPE_ORIENTATIONS]; 45 } 46} 47 48function setOrientation(config, infoPlist) { 49 const orientation = getOrientation(config); 50 return { ...infoPlist, 51 UISupportedInterfaceOrientations: getUISupportedInterfaceOrientations(orientation) 52 }; 53} 54//# sourceMappingURL=Orientation.js.map