UNPKG

1.86 kBSource Map (JSON)View Raw
1{"version":3,"file":"Orientation.js","sourceRoot":"","sources":["../../src/ios/Orientation.ts"],"names":[],"mappings":";;AAGA,SAAgB,cAAc,CAAC,MAAkB;IAC/C,IAAI,MAAM,CAAC,WAAW,EAAE;QACtB,OAAO,MAAM,CAAC,WAAW,CAAC;KAC3B;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAND,wCAMC;AAEY,QAAA,qBAAqB,GAAG;IACnC,gCAAgC;IAChC,0CAA0C;CAC3C,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,qCAAqC;IACrC,sCAAsC;CACvC,CAAC;AAEF,SAAS,mCAAmC,CAAC,WAA0B;IACrE,IAAI,WAAW,KAAK,UAAU,EAAE;QAC9B,OAAO,6BAAqB,CAAC;KAC9B;SAAM,IAAI,WAAW,KAAK,WAAW,EAAE;QACtC,OAAO,8BAAsB,CAAC;KAC/B;SAAM;QACL,OAAO,CAAC,GAAG,6BAAqB,EAAE,GAAG,8BAAsB,CAAC,CAAC;KAC9D;AACH,CAAC;AAED,SAAgB,cAAc,CAAC,MAAkB,EAAE,SAAoB;IACrE,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAE3C,uCACK,SAAS,KACZ,gCAAgC,EAAE,mCAAmC,CAAC,WAAW,CAAC,IAClF;AACJ,CAAC;AAPD,wCAOC","sourcesContent":["import { InfoPlist } from './IosConfig.types';\nimport { ExpoConfig } from '../Config.types';\n\nexport function getOrientation(config: ExpoConfig) {\n if (config.orientation) {\n return config.orientation;\n }\n\n return null;\n}\n\nexport const PORTRAIT_ORIENTATIONS = [\n 'UIInterfaceOrientationPortrait',\n 'UIInterfaceOrientationPortraitUpsideDown',\n];\n\nexport const LANDSCAPE_ORIENTATIONS = [\n 'UIInterfaceOrientationLandscapeLeft',\n 'UIInterfaceOrientationLandscapeRight',\n];\n\nfunction getUISupportedInterfaceOrientations(orientation: string | null) {\n if (orientation === 'portrait') {\n return PORTRAIT_ORIENTATIONS;\n } else if (orientation === 'landscape') {\n return LANDSCAPE_ORIENTATIONS;\n } else {\n return [...PORTRAIT_ORIENTATIONS, ...LANDSCAPE_ORIENTATIONS];\n }\n}\n\nexport function setOrientation(config: ExpoConfig, infoPlist: InfoPlist) {\n const orientation = getOrientation(config);\n\n return {\n ...infoPlist,\n UISupportedInterfaceOrientations: getUISupportedInterfaceOrientations(orientation),\n };\n}\n"]}
\No newline at end of file