1 line
2.1 KiB
Plaintext
1 line
2.1 KiB
Plaintext
![]() |
{"version":3,"file":"Orientation.js","sourceRoot":"","sources":["../../src/ios/Orientation.ts"],"names":[],"mappings":";;AAEA,wDAA+D;AAGlD,QAAA,eAAe,GAAG,mCAAqB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAExF,SAAgB,cAAc,CAAC,MAAuC;;IACpE,aAAO,MAAM,CAAC,WAAW,mCAAI,IAAI,CAAC;AACpC,CAAC;AAFD,wCAEC;AAEY,QAAA,qBAAqB,GAA2B;IAC3D,gCAAgC;IAChC,0CAA0C;CAC3C,CAAC;AAEW,QAAA,sBAAsB,GAA2B;IAC5D,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,CAC5B,MAAuC,EACvC,SAAoB;IAEpB,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAE3C,uCACK,SAAS,KACZ,gCAAgC,EAAE,mCAAmC,CAAC,WAAW,CAAC,IAClF;AACJ,CAAC;AAVD,wCAUC","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { InfoPlist, InterfaceOrientation } from './IosConfig.types';\n\nexport const withOrientation = createInfoPlistPlugin(setOrientation, 'withOrientation');\n\nexport function getOrientation(config: Pick<ExpoConfig, 'orientation'>) {\n return config.orientation ?? null;\n}\n\nexport const PORTRAIT_ORIENTATIONS: InterfaceOrientation[] = [\n 'UIInterfaceOrientationPortrait',\n 'UIInterfaceOrientationPortraitUpsideDown',\n];\n\nexport const LANDSCAPE_ORIENTATIONS: InterfaceOrientation[] = [\n 'UIInterfaceOrientationLandscapeLeft',\n 'UIInterfaceOrientationLandscapeRight',\n];\n\nfunction getUISupportedInterfaceOrientations(orientation: string | null): InterfaceOrientation[] {\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(\n config: Pick<ExpoConfig, 'orientation'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const orientation = getOrientation(config);\n\n return {\n ...infoPlist,\n UISupportedInterfaceOrientations: getUISupportedInterfaceOrientations(orientation),\n };\n}\n"]}
|