@expo/prebuild-config 8.0.12 → 8.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js +1 -1
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.d.ts +3 -2
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.js +4 -2
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js +7 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.d.ts +4 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js +36 -22
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js +3 -3
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js.map +1 -1
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@ function getAndroidSplashConfig(config, props) {
|
|
|
19
19
|
mdpi: splash.mdpi ?? splash.image,
|
|
20
20
|
backgroundColor: splash.backgroundColor,
|
|
21
21
|
resizeMode: splash.resizeMode ?? defaultResizeMode,
|
|
22
|
-
imageWidth: splash.imageWidth
|
|
22
|
+
imageWidth: splash.imageWidth ?? 100
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
if (config.android?.splash) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAndroidSplashConfig.js","names":["defaultResizeMode","getAndroidSplashConfig","config","props","splash","xxxhdpi","image","xxhdpi","xhdpi","hdpi","mdpi","backgroundColor","resizeMode","imageWidth","android","getAndroidDarkSplashConfig","dark","lightTheme"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nexport type SplashScreenConfig = {\n xxxhdpi?: string;\n xxhdpi?: string;\n xhdpi?: string;\n hdpi?: string;\n mdpi?: string;\n image?: string;\n backgroundColor?: string;\n resizeMode: 'contain' | 'cover' | 'native';\n dark?: {\n backgroundColor?: string;\n xxxhdpi?: string;\n xxhdpi?: string;\n xhdpi?: string;\n hdpi?: string;\n mdpi?: string;\n image?: string;\n resizeMode?: 'contain' | 'cover' | 'native';\n };\n};\n\nexport type AndroidSplashConfig = {\n imageWidth?: number;\n} & SplashScreenConfig;\n\nconst defaultResizeMode = 'contain';\n\nexport function getAndroidSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>,\n props?: AndroidSplashConfig | null\n): AndroidSplashConfig | null {\n // Respect the splash screen object, don't mix and match across different splash screen objects\n // in case the user wants the top level splash to apply to every platform except android.\n if (props) {\n const splash = props;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: splash.imageWidth,\n };\n }\n\n if (config.android?.splash) {\n const splash = config.android?.splash;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n image: splash.image,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: 200,\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n return {\n xxxhdpi: splash.image,\n xxhdpi: splash.image,\n xhdpi: splash.image,\n hdpi: splash.image,\n mdpi: splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: 200,\n };\n }\n\n return null;\n}\n\nexport function getAndroidDarkSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>,\n props?: AndroidSplashConfig | null\n): SplashScreenConfig | null {\n if (props?.dark) {\n const splash = props.dark;\n const lightTheme = getAndroidSplashConfig(config, props);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: lightTheme?.resizeMode ?? defaultResizeMode,\n };\n }\n\n // Respect the splash screen object, don't mix and match across different splash screen objects\n // in case the user wants the top level splash to apply to every platform except android.\n if (config.android?.splash?.dark) {\n const splash = config.android?.splash?.dark;\n const lightTheme = getAndroidSplashConfig(config, props);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n // Can't support dark resizeMode because the resize mode is hardcoded into the MainActivity.java\n resizeMode: lightTheme?.resizeMode ?? defaultResizeMode,\n };\n }\n\n return null;\n}\n"],"mappings":";;;;;;;AA2BA,MAAMA,iBAAiB,GAAG,SAAS;AAE5B,SAASC,sBAAsBA,CACpCC,MAA8C,EAC9CC,KAAkC,EACN;EAC5B;EACA;EACA,IAAIA,KAAK,EAAE;IACT,MAAMC,MAAM,GAAGD,KAAK;IACpB,OAAO;MACLE,OAAO,EAAED,MAAM,CAACC,OAAO,IAAID,MAAM,CAACE,KAAK;MACvCC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAIH,MAAM,CAACE,KAAK;MACrCE,KAAK,EAAEJ,MAAM,CAACI,KAAK,IAAIJ,MAAM,CAACE,KAAK;MACnCG,IAAI,EAAEL,MAAM,CAACK,IAAI,IAAIL,MAAM,CAACE,KAAK;MACjCI,IAAI,EAAEN,MAAM,CAACM,IAAI,IAAIN,MAAM,CAACE,KAAK;MACjCK,eAAe,EAAEP,MAAM,CAACO,eAAe;MACvCC,UAAU,EAAER,MAAM,CAACQ,UAAU,IAAIZ,iBAAiB;MAClDa,UAAU,EAAET,MAAM,CAACS;
|
|
1
|
+
{"version":3,"file":"getAndroidSplashConfig.js","names":["defaultResizeMode","getAndroidSplashConfig","config","props","splash","xxxhdpi","image","xxhdpi","xhdpi","hdpi","mdpi","backgroundColor","resizeMode","imageWidth","android","getAndroidDarkSplashConfig","dark","lightTheme"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nexport type SplashScreenConfig = {\n xxxhdpi?: string;\n xxhdpi?: string;\n xhdpi?: string;\n hdpi?: string;\n mdpi?: string;\n image?: string;\n backgroundColor?: string;\n resizeMode: 'contain' | 'cover' | 'native';\n dark?: {\n backgroundColor?: string;\n xxxhdpi?: string;\n xxhdpi?: string;\n xhdpi?: string;\n hdpi?: string;\n mdpi?: string;\n image?: string;\n resizeMode?: 'contain' | 'cover' | 'native';\n };\n};\n\nexport type AndroidSplashConfig = {\n imageWidth?: number;\n} & SplashScreenConfig;\n\nconst defaultResizeMode = 'contain';\n\nexport function getAndroidSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>,\n props?: AndroidSplashConfig | null\n): AndroidSplashConfig | null {\n // Respect the splash screen object, don't mix and match across different splash screen objects\n // in case the user wants the top level splash to apply to every platform except android.\n if (props) {\n const splash = props;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: splash.imageWidth ?? 100,\n };\n }\n\n if (config.android?.splash) {\n const splash = config.android?.splash;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n image: splash.image,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: 200,\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n return {\n xxxhdpi: splash.image,\n xxhdpi: splash.image,\n xhdpi: splash.image,\n hdpi: splash.image,\n mdpi: splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: 200,\n };\n }\n\n return null;\n}\n\nexport function getAndroidDarkSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>,\n props?: AndroidSplashConfig | null\n): SplashScreenConfig | null {\n if (props?.dark) {\n const splash = props.dark;\n const lightTheme = getAndroidSplashConfig(config, props);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: lightTheme?.resizeMode ?? defaultResizeMode,\n };\n }\n\n // Respect the splash screen object, don't mix and match across different splash screen objects\n // in case the user wants the top level splash to apply to every platform except android.\n if (config.android?.splash?.dark) {\n const splash = config.android?.splash?.dark;\n const lightTheme = getAndroidSplashConfig(config, props);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n // Can't support dark resizeMode because the resize mode is hardcoded into the MainActivity.java\n resizeMode: lightTheme?.resizeMode ?? defaultResizeMode,\n };\n }\n\n return null;\n}\n"],"mappings":";;;;;;;AA2BA,MAAMA,iBAAiB,GAAG,SAAS;AAE5B,SAASC,sBAAsBA,CACpCC,MAA8C,EAC9CC,KAAkC,EACN;EAC5B;EACA;EACA,IAAIA,KAAK,EAAE;IACT,MAAMC,MAAM,GAAGD,KAAK;IACpB,OAAO;MACLE,OAAO,EAAED,MAAM,CAACC,OAAO,IAAID,MAAM,CAACE,KAAK;MACvCC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAIH,MAAM,CAACE,KAAK;MACrCE,KAAK,EAAEJ,MAAM,CAACI,KAAK,IAAIJ,MAAM,CAACE,KAAK;MACnCG,IAAI,EAAEL,MAAM,CAACK,IAAI,IAAIL,MAAM,CAACE,KAAK;MACjCI,IAAI,EAAEN,MAAM,CAACM,IAAI,IAAIN,MAAM,CAACE,KAAK;MACjCK,eAAe,EAAEP,MAAM,CAACO,eAAe;MACvCC,UAAU,EAAER,MAAM,CAACQ,UAAU,IAAIZ,iBAAiB;MAClDa,UAAU,EAAET,MAAM,CAACS,UAAU,IAAI;IACnC,CAAC;EACH;EAEA,IAAIX,MAAM,CAACY,OAAO,EAAEV,MAAM,EAAE;IAC1B,MAAMA,MAAM,GAAGF,MAAM,CAACY,OAAO,EAAEV,MAAM;IACrC,OAAO;MACLC,OAAO,EAAED,MAAM,CAACC,OAAO,IAAID,MAAM,CAACE,KAAK;MACvCC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAIH,MAAM,CAACE,KAA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MAAM,CAACK,IAAI,IAAIL,MAAM,CAACE,KAAK;MACjCI,IAAI,EAAEN,MAAM,CAACM,IAAI,IAAIN,MAAM,CAACE,KAAK;MACjCK,eAAe,EAAEP,MAAM,CAACO,eAAe;MACvCC,UAAU,EAAEK,UAAU,EAAEL,UAAU,IAAIZ;IACxC,CAAC;EACH;;EAEA;EACA;EACA,IAAIE,MAAM,CAACY,OAAO,EAAEV,MAAM,EAAEY,IAAI,EAAE;IAChC,MAAMZ,MAAM,GAAGF,MAAM,CAACY,OAAO,EAAEV,MAAM,EAAEY,IAAI;IAC3C,MAAMC,UAAU,GAAGhB,sBAAsB,CAACC,MAAM,EAAEC,KAAK,CAAC;IACxD,OAAO;MACLE,OAAO,EAAED,MAAM,CAACC,OAAO,IAAID,MAAM,CAACE,KAAK;MACvCC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAIH,MAAM,CAACE,KAAK;MACrCE,KAAK,EAAEJ,MAAM,CAACI,KAAK,IAAIJ,MAAM,CAACE,KAAK;MACnCG,IAAI,EAAEL,MAAM,CAACK,IAAI,IAAIL,MAAM,CAACE,KAAK;MACjCI,IAAI,EAAEN,MAAM,CAACM,IAAI,IAAIN,MAAM,CAACE,KAAK;MACjCK,eAAe,EAAEP,MAAM,CAACO,eAAe;MACvC;MACAC,UAAU,EAAEK,UAAU,EAAEL,UAAU,IAAIZ;IACxC,CAAC;EACH;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashDrawables.js","names":["_configPlugins","data","require","withAndroidSplashDrawables","config","splash","withDangerousMod","setSplashDrawableAsync","modRequest","projectRoot","exports","resizeMode","filePath","AndroidConfig","Paths","getResourceXMLPathAsync","name","kind","xmlContent","$","item","bitmap","filter","Boolean","XML","writeXMLAsync","path","xml"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withDangerousMod, XML } from '@expo/config-plugins';\n\nimport { SplashScreenConfig } from './getAndroidSplashConfig';\n\nexport const withAndroidSplashDrawables: ConfigPlugin<Pick<SplashScreenConfig, 'resizeMode'>> = (\n config,\n splash\n) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n if (splash) {\n await setSplashDrawableAsync(splash, config.modRequest.projectRoot);\n }\n return config;\n },\n ]);\n};\n\nexport async function setSplashDrawableAsync(\n { resizeMode }: Pick<SplashScreenConfig, 'resizeMode'>,\n projectRoot: string\n) {\n const filePath = (await AndroidConfig.Paths.getResourceXMLPathAsync(projectRoot, {\n name: 'ic_launcher_background',\n kind: 'drawable',\n }))!;\n\n // Nuke and rewrite the splashscreen.xml drawable\n const xmlContent = {\n 'layer-list': {\n $: {\n 'xmlns:android': 'http://schemas.android.com/apk/res/android',\n },\n item: [\n {\n $: {\n // TODO: Ensure these keys don't get out of sync\n 'android:drawable': '@color/splashscreen_background',\n },\n },\n // Only include the image if resizeMode native is in-use.\n
|
|
1
|
+
{"version":3,"file":"withAndroidSplashDrawables.js","names":["_configPlugins","data","require","withAndroidSplashDrawables","config","splash","withDangerousMod","setSplashDrawableAsync","modRequest","projectRoot","exports","resizeMode","filePath","AndroidConfig","Paths","getResourceXMLPathAsync","name","kind","xmlContent","$","item","bitmap","filter","Boolean","XML","writeXMLAsync","path","xml"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withDangerousMod, XML } from '@expo/config-plugins';\n\nimport { SplashScreenConfig } from './getAndroidSplashConfig';\n\nexport const withAndroidSplashDrawables: ConfigPlugin<Pick<SplashScreenConfig, 'resizeMode'>> = (\n config,\n splash\n) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n if (splash) {\n await setSplashDrawableAsync(splash, config.modRequest.projectRoot);\n }\n return config;\n },\n ]);\n};\n\nexport async function setSplashDrawableAsync(\n { resizeMode }: Pick<SplashScreenConfig, 'resizeMode'>,\n projectRoot: string\n) {\n const filePath = (await AndroidConfig.Paths.getResourceXMLPathAsync(projectRoot, {\n name: 'ic_launcher_background',\n kind: 'drawable',\n }))!;\n\n // Nuke and rewrite the splashscreen.xml drawable\n const xmlContent = {\n 'layer-list': {\n $: {\n 'xmlns:android': 'http://schemas.android.com/apk/res/android',\n },\n item: [\n {\n $: {\n // TODO: Ensure these keys don't get out of sync\n 'android:drawable': '@color/splashscreen_background',\n },\n },\n // Only include the image if resizeMode native is in-use.\n {\n bitmap: [\n {\n $: {\n 'android:gravity': 'center',\n // TODO: Ensure these keys don't get out of sync\n 'android:src': '@drawable/splashscreen_logo',\n },\n },\n ],\n },\n ].filter(Boolean),\n },\n };\n await XML.writeXMLAsync({ path: filePath, xml: xmlContent });\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,MAAME,0BAAgF,GAAGA,CAC9FC,MAAM,EACNC,MAAM,KACH;EACH,OAAO,IAAAC,iCAAgB,EAACF,MAAM,EAAE,CAC9B,SAAS,EACT,MAAOA,MAAM,IAAK;IAChB,IAAIC,MAAM,EAAE;MACV,MAAME,sBAAsB,CAACF,MAAM,EAAED,MAAM,CAACI,UAAU,CAACC,WAAW,CAAC;IACrE;IACA,OAAOL,MAAM;EACf,CAAC,CACF,CAAC;AACJ,CAAC;AAACM,OAAA,CAAAP,0BAAA,GAAAA,0BAAA;AAEK,eAAeI,sBAAsBA,CAC1C;EAAEI;AAAmD,CAAC,EACtDF,WAAmB,EACnB;EACA,MAAMG,QAAQ,GAAI,MAAMC,8BAAa,CAACC,KAAK,CAACC,uBAAuB,CAACN,WAAW,EAAE;IAC/EO,IAAI,EAAE,wBAAwB;IAC9BC,IAAI,EAAE;EACR,CAAC,CAAG;;EAEJ;EACA,MAAMC,UAAU,GAAG;IACjB,YAAY,EAAE;MACZC,CAAC,EAAE;QACD,eAAe,EAAE;MACnB,CAAC;MACDC,IAAI,EAAE,CACJ;QACED,CAAC,EAAE;UACD;UACA,kBAAkB,EAAE;QACtB;MACF,CAAC;MACD;MACA;QACEE,MAAM,EAAE,CACN;UACEF,CAAC,EAAE;YACD,iBAAiB,EAAE,QAAQ;YAC3B;YACA,aAAa,EAAE;UACjB;QACF,CAAC;MAEL,CAAC,CACF,CAACG,MAAM,CAACC,OAAO;IAClB;EACF,CAAC;EACD,MAAMC,oBAAG,CAACC,aAAa,CAAC;IAAEC,IAAI,EAAEd,QAAQ;IAAEe,GAAG,EAAET;EAAW,CAAC,CAAC;AAC9D","ignoreList":[]}
|
|
@@ -114,7 +114,7 @@ const DRAWABLES_CONFIGS = {
|
|
|
114
114
|
};
|
|
115
115
|
const withAndroidSplashImages = (config, props) => {
|
|
116
116
|
return (0, _configPlugins().withDangerousMod)(config, ['android', async config => {
|
|
117
|
-
await setSplashImageDrawablesAsync(config, props, config.modRequest.projectRoot, props?.imageWidth ??
|
|
117
|
+
await setSplashImageDrawablesAsync(config, props, config.modRequest.projectRoot, props?.imageWidth ?? 200);
|
|
118
118
|
return config;
|
|
119
119
|
}]);
|
|
120
120
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashImages.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_getAndroidSplashConfig","e","__esModule","default","IMAGE_CACHE_NAME","SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","props","withDangerousMod","setSplashImageDrawablesAsync","modRequest","projectRoot","imageWidth","exports","clearAllExistingSplashImagesAsync","splash","getAndroidSplashConfig","darkSplash","getAndroidDarkSplashConfig","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","sizes","imageKey","image","multiplier","size","canvasSize","background","generateImageBackgroundAsync","width","height","backgroundColor","resizeMode","source","foreground","generateImageAsync","cacheType","src","composedImage","compositeImagesAsync","x","y","outputPath","folder","dirname","ensureDir","writeFile"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts"],"sourcesContent":["import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport {\n generateImageAsync,\n compositeImagesAsync,\n generateImageBackgroundAsync,\n} from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\n AndroidSplashConfig,\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n SplashScreenConfig,\n} from './getAndroidSplashConfig';\n\ntype DRAWABLE_SIZE = 'default' | 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype THEME = 'light' | 'dark';\n\nconst IMAGE_CACHE_NAME = 'splash-android';\nconst SPLASH_SCREEN_FILENAME = 'splashscreen_logo.png';\nconst DRAWABLES_CONFIGS: {\n [key in DRAWABLE_SIZE]: {\n modes: {\n [key in THEME]: {\n path: string;\n };\n };\n dimensionsMultiplier: number;\n };\n} = {\n default: {\n modes: {\n light: {\n path: `./res/drawable/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n mdpi: {\n modes: {\n light: {\n path: `./res/drawable-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n hdpi: {\n modes: {\n light: {\n path: `./res/drawable-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1.5,\n },\n xhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 2,\n },\n xxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 3,\n },\n xxxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 4,\n },\n};\n\nexport const withAndroidSplashImages: ConfigPlugin<AndroidSplashConfig> = (config, props) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setSplashImageDrawablesAsync(\n config,\n props,\n config.modRequest.projectRoot,\n props?.imageWidth ?? 100\n );\n return config;\n },\n ]);\n};\n\n/**\n * Deletes all previous splash_screen_images and copies new one to desired drawable directory.\n * If path isn't provided then no new image is placed in drawable directories.\n * @see https://developer.android.com/training/multiscreen/screendensities\n *\n * @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.\n */\nexport async function setSplashImageDrawablesAsync(\n config: Pick<ExpoConfig, 'android' | 'splash'>,\n props: AndroidSplashConfig | null,\n projectRoot: string,\n imageWidth: number\n) {\n await clearAllExistingSplashImagesAsync(projectRoot);\n\n const splash = getAndroidSplashConfig(config, props);\n const darkSplash = getAndroidDarkSplashConfig(config, props);\n\n await Promise.all([\n setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot, imageWidth),\n setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot, imageWidth),\n ]);\n}\n\nasync function clearAllExistingSplashImagesAsync(projectRoot: string) {\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n Object.values(DRAWABLES_CONFIGS).map(async ({ modes }) => {\n await Promise.all(\n Object.values(modes).map(async ({ path: filePath }) => {\n if (await fs.pathExists(path.resolve(androidMainPath, filePath))) {\n await fs.remove(path.resolve(androidMainPath, filePath));\n }\n })\n );\n })\n );\n}\n\nexport async function setSplashImageDrawablesForThemeAsync(\n config: SplashScreenConfig | null,\n theme: 'dark' | 'light',\n projectRoot: string,\n imageWidth: number = 100\n) {\n if (!config) return;\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n const sizes: DRAWABLE_SIZE[] = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'];\n\n await Promise.all(\n sizes.map(async (imageKey) => {\n // @ts-ignore\n const image = config[imageKey];\n\n if (image) {\n const multiplier = DRAWABLES_CONFIGS[imageKey].dimensionsMultiplier;\n const size = imageWidth * multiplier; // \"imageWidth\" must be replaced by the logo width chosen by the user in its config file\n const canvasSize = 288 * multiplier;\n\n const background = await generateImageBackgroundAsync({\n width: canvasSize,\n height: canvasSize,\n backgroundColor: config.backgroundColor ?? 'transparent',\n resizeMode: 'cover',\n });\n\n const { source: foreground } = await generateImageAsync(\n {\n projectRoot,\n cacheType: IMAGE_CACHE_NAME,\n },\n {\n src: image,\n resizeMode: 'contain',\n width: size,\n height: size,\n }\n );\n\n const composedImage = await compositeImagesAsync({\n background,\n foreground,\n x: (canvasSize - size) / 2,\n y: (canvasSize - size) / 2,\n });\n\n // Get output path for drawable.\n const outputPath = path.join(\n androidMainPath,\n DRAWABLES_CONFIGS[imageKey].modes[theme].path\n );\n\n const folder = path.dirname(outputPath);\n // Ensure directory exists.\n await fs.ensureDir(folder);\n await fs.writeFile(outputPath, composedImage);\n }\n return null;\n })\n );\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAA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,EACf5B,iBAAiB,CAACwC,QAAQ,CAAC,CAACvC,KAAK,CAACqC,KAAK,CAAC,CAACnC,IAC3C,CAAC;MAED,MAAM0D,MAAM,GAAG1D,eAAI,CAAC2D,OAAO,CAACF,UAAU,CAAC;MACvC;MACA,MAAM1B,kBAAE,CAAC6B,SAAS,CAACF,MAAM,CAAC;MAC1B,MAAM3B,kBAAE,CAAC8B,SAAS,CAACJ,UAAU,EAAEJ,aAAa,CAAC;IAC/C;IACA,OAAO,IAAI;EACb,CAAC,CACH,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"withAndroidSplashImages.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_getAndroidSplashConfig","e","__esModule","default","IMAGE_CACHE_NAME","SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","props","withDangerousMod","setSplashImageDrawablesAsync","modRequest","projectRoot","imageWidth","exports","clearAllExistingSplashImagesAsync","splash","getAndroidSplashConfig","darkSplash","getAndroidDarkSplashConfig","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","sizes","imageKey","image","multiplier","size","canvasSize","background","generateImageBackgroundAsync","width","height","backgroundColor","resizeMode","source","foreground","generateImageAsync","cacheType","src","composedImage","compositeImagesAsync","x","y","outputPath","folder","dirname","ensureDir","writeFile"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts"],"sourcesContent":["import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport {\n generateImageAsync,\n compositeImagesAsync,\n generateImageBackgroundAsync,\n} from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\n AndroidSplashConfig,\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n SplashScreenConfig,\n} from './getAndroidSplashConfig';\n\ntype DRAWABLE_SIZE = 'default' | 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype THEME = 'light' | 'dark';\n\nconst IMAGE_CACHE_NAME = 'splash-android';\nconst SPLASH_SCREEN_FILENAME = 'splashscreen_logo.png';\nconst DRAWABLES_CONFIGS: {\n [key in DRAWABLE_SIZE]: {\n modes: {\n [key in THEME]: {\n path: string;\n };\n };\n dimensionsMultiplier: number;\n };\n} = {\n default: {\n modes: {\n light: {\n path: `./res/drawable/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n mdpi: {\n modes: {\n light: {\n path: `./res/drawable-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n hdpi: {\n modes: {\n light: {\n path: `./res/drawable-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1.5,\n },\n xhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 2,\n },\n xxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 3,\n },\n xxxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 4,\n },\n};\n\nexport const withAndroidSplashImages: ConfigPlugin<AndroidSplashConfig> = (config, props) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setSplashImageDrawablesAsync(\n config,\n props,\n config.modRequest.projectRoot,\n props?.imageWidth ?? 200\n );\n return config;\n },\n ]);\n};\n\n/**\n * Deletes all previous splash_screen_images and copies new one to desired drawable directory.\n * If path isn't provided then no new image is placed in drawable directories.\n * @see https://developer.android.com/training/multiscreen/screendensities\n *\n * @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.\n */\nexport async function setSplashImageDrawablesAsync(\n config: Pick<ExpoConfig, 'android' | 'splash'>,\n props: AndroidSplashConfig | null,\n projectRoot: string,\n imageWidth: number\n) {\n await clearAllExistingSplashImagesAsync(projectRoot);\n\n const splash = getAndroidSplashConfig(config, props);\n const darkSplash = getAndroidDarkSplashConfig(config, props);\n\n await Promise.all([\n setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot, imageWidth),\n setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot, imageWidth),\n ]);\n}\n\nasync function clearAllExistingSplashImagesAsync(projectRoot: string) {\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n Object.values(DRAWABLES_CONFIGS).map(async ({ modes }) => {\n await Promise.all(\n Object.values(modes).map(async ({ path: filePath }) => {\n if (await fs.pathExists(path.resolve(androidMainPath, filePath))) {\n await fs.remove(path.resolve(androidMainPath, filePath));\n }\n })\n );\n })\n );\n}\n\nexport async function setSplashImageDrawablesForThemeAsync(\n config: SplashScreenConfig | null,\n theme: 'dark' | 'light',\n projectRoot: string,\n imageWidth: number = 100\n) {\n if (!config) return;\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n const sizes: DRAWABLE_SIZE[] = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'];\n\n await Promise.all(\n sizes.map(async (imageKey) => {\n // @ts-ignore\n const image = config[imageKey];\n\n if (image) {\n const multiplier = DRAWABLES_CONFIGS[imageKey].dimensionsMultiplier;\n const size = imageWidth * multiplier; // \"imageWidth\" must be replaced by the logo width chosen by the user in its config file\n const canvasSize = 288 * multiplier;\n\n const background = await generateImageBackgroundAsync({\n width: canvasSize,\n height: canvasSize,\n backgroundColor: config.backgroundColor ?? 'transparent',\n resizeMode: 'cover',\n });\n\n const { source: foreground } = await generateImageAsync(\n {\n projectRoot,\n cacheType: IMAGE_CACHE_NAME,\n },\n {\n src: image,\n resizeMode: 'contain',\n width: size,\n height: size,\n }\n );\n\n const composedImage = await compositeImagesAsync({\n background,\n foreground,\n x: (canvasSize - size) / 2,\n y: (canvasSize - size) / 2,\n });\n\n // Get output path for drawable.\n const outputPath = path.join(\n androidMainPath,\n DRAWABLES_CONFIGS[imageKey].modes[theme].path\n );\n\n const folder = path.dirname(outputPath);\n // Ensure directory exists.\n await fs.ensureDir(folder);\n await fs.writeFile(outputPath, composedImage);\n }\n return null;\n })\n );\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,wBA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
|
|
2
|
+
export declare const withAndroidSplashMainActivity: ConfigPlugin<{
|
|
3
|
+
isLegacyConfig: boolean;
|
|
4
|
+
}>;
|
|
@@ -25,8 +25,10 @@ function _generateCode() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
const withAndroidSplashMainActivity = (config,
|
|
29
|
-
|
|
28
|
+
const withAndroidSplashMainActivity = (config, {
|
|
29
|
+
isLegacyConfig
|
|
30
|
+
}) => {
|
|
31
|
+
if (isLegacyConfig) {
|
|
30
32
|
return config;
|
|
31
33
|
}
|
|
32
34
|
return (0, _configPlugins().withMainActivity)(config, config => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashMainActivity.js","names":["_configPlugins","data","require","_codeMod","_generateCode","withAndroidSplashMainActivity","config","
|
|
1
|
+
{"version":3,"file":"withAndroidSplashMainActivity.js","names":["_configPlugins","data","require","_codeMod","_generateCode","withAndroidSplashMainActivity","config","isLegacyConfig","withMainActivity","modResults","language","withImports","addImports","contents","replace","init","mergeContents","src","comment","tag","offset","anchor","newSrc","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.ts"],"sourcesContent":["import { ConfigPlugin, withMainActivity } from '@expo/config-plugins';\nimport { addImports } from '@expo/config-plugins/build/android/codeMod';\nimport { mergeContents } from '@expo/config-plugins/build/utils/generateCode';\n\nexport const withAndroidSplashMainActivity: ConfigPlugin<{ isLegacyConfig: boolean }> = (\n config,\n { isLegacyConfig }\n) => {\n if (isLegacyConfig) {\n return config;\n }\n return withMainActivity(config, (config) => {\n const { modResults } = config;\n const { language } = modResults;\n\n const withImports = addImports(\n modResults.contents.replace(\n /(\\/\\/ )?setTheme\\(R\\.style\\.AppTheme\\)/,\n '// setTheme(R.style.AppTheme)'\n ),\n ['expo.modules.splashscreen.SplashScreenManager'],\n language === 'java'\n );\n\n const init = mergeContents({\n src: withImports,\n comment: ' //',\n tag: 'expo-splashscreen',\n offset: 0,\n anchor: /super\\.onCreate\\(null\\)/,\n newSrc: ' SplashScreenManager.registerOnActivity(this)' + (language === 'java' ? ';' : ''),\n });\n\n return {\n ...config,\n modResults: {\n ...modResults,\n contents: init.contents,\n },\n };\n });\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMI,6BAAwE,GAAGA,CACtFC,MAAM,EACN;EAAEC;AAAe,CAAC,KACf;EACH,IAAIA,cAAc,EAAE;IAClB,OAAOD,MAAM;EACf;EACA,OAAO,IAAAE,iCAAgB,EAACF,MAAM,EAAGA,MAAM,IAAK;IAC1C,MAAM;MAAEG;IAAW,CAAC,GAAGH,MAAM;IAC7B,MAAM;MAAEI;IAAS,CAAC,GAAGD,UAAU;IAE/B,MAAME,WAAW,GAAG,IAAAC,qBAAU,EAC5BH,UAAU,CAACI,QAAQ,CAACC,OAAO,CACzB,wCAAwC,EACxC,+BACF,CAAC,EACD,CAAC,+CAA+C,CAAC,EACjDJ,QAAQ,KAAK,MACf,CAAC;IAED,MAAMK,IAAI,GAAG,IAAAC,6BAAa,EAAC;MACzBC,GAAG,EAAEN,WAAW;MAChBO,OAAO,EAAE,QAAQ;MACjBC,GAAG,EAAE,mBAAmB;MACxBC,MAAM,EAAE,CAAC;MACTC,MAAM,EAAE,yBAAyB;MACjCC,MAAM,EAAE,kDAAkD,IAAIZ,QAAQ,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;IAC9F,CAAC,CAAC;IAEF,OAAO;MACL,GAAGJ,MAAM;MACTG,UAAU,EAAE;QACV,GAAGA,UAAU;QACbI,QAAQ,EAAEE,IAAI,CAACF;MACjB;IACF,CAAC;EACH,CAAC,CAAC;AACJ,CAAC;AAACU,OAAA,CAAAlB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
|
@@ -54,6 +54,7 @@ function _withAndroidSplashStyles() {
|
|
|
54
54
|
return data;
|
|
55
55
|
}
|
|
56
56
|
const withAndroidSplashScreen = (config, props) => {
|
|
57
|
+
const isLegacyConfig = props === undefined;
|
|
57
58
|
const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config, props ?? null);
|
|
58
59
|
|
|
59
60
|
// Update the android status bar to match the splash screen
|
|
@@ -67,7 +68,12 @@ const withAndroidSplashScreen = (config, props) => {
|
|
|
67
68
|
if (!config.androidStatusBar) config.androidStatusBar = {};
|
|
68
69
|
config.androidStatusBar.backgroundColor = backgroundColor;
|
|
69
70
|
}
|
|
70
|
-
return (0, _configPlugins().withPlugins)(config, [[_withAndroidSplashMainActivity().withAndroidSplashMainActivity,
|
|
71
|
+
return (0, _configPlugins().withPlugins)(config, [[_withAndroidSplashMainActivity().withAndroidSplashMainActivity, {
|
|
72
|
+
isLegacyConfig
|
|
73
|
+
}], [_withAndroidSplashImages().withAndroidSplashImages, splashConfig], [_withAndroidSplashDrawables().withAndroidSplashDrawables, splashConfig], [_withAndroidSplashStyles().withAndroidSplashStyles, {
|
|
74
|
+
splashConfig,
|
|
75
|
+
isLegacyConfig
|
|
76
|
+
}], [_withAndroidSplashStrings().withAndroidSplashStrings, splashConfig]]);
|
|
71
77
|
};
|
|
72
78
|
exports.withAndroidSplashScreen = withAndroidSplashScreen;
|
|
73
79
|
//# sourceMappingURL=withAndroidSplashScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashScreen.js","names":["_configPlugins","data","require","_getAndroidSplashConfig","_withAndroidSplashDrawables","_withAndroidSplashImages","_withAndroidSplashMainActivity","_withAndroidSplashStrings","_withAndroidSplashStyles","withAndroidSplashScreen","config","props","splashConfig","getAndroidSplashConfig","backgroundColor","androidStatusBar","toLowerCase","WarningAggregator","addWarningAndroid","withPlugins","withAndroidSplashMainActivity","withAndroidSplashImages","withAndroidSplashDrawables","withAndroidSplashStyles","withAndroidSplashStrings","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withPlugins } from '@expo/config-plugins';\n\nimport { AndroidSplashConfig, getAndroidSplashConfig } from './getAndroidSplashConfig';\nimport { withAndroidSplashDrawables } from './withAndroidSplashDrawables';\nimport { withAndroidSplashImages } from './withAndroidSplashImages';\nimport { withAndroidSplashMainActivity } from './withAndroidSplashMainActivity';\nimport { withAndroidSplashStrings } from './withAndroidSplashStrings';\nimport { withAndroidSplashStyles } from './withAndroidSplashStyles';\n\nexport const withAndroidSplashScreen: ConfigPlugin<\n AndroidSplashConfig | undefined | null | void\n> = (config, props) => {\n const splashConfig = getAndroidSplashConfig(config, props ?? null);\n\n // Update the android status bar to match the splash screen\n // androidStatusBar applies info to the app activity style.\n const backgroundColor = splashConfig?.backgroundColor || '#ffffff';\n if (config.androidStatusBar?.backgroundColor) {\n if (\n backgroundColor.toLowerCase() !== config.androidStatusBar?.backgroundColor?.toLowerCase?.()\n ) {\n WarningAggregator.addWarningAndroid(\n 'androidStatusBar.backgroundColor',\n 'Color conflicts with the splash.backgroundColor'\n );\n }\n } else {\n if (!config.androidStatusBar) config.androidStatusBar = {};\n config.androidStatusBar.backgroundColor = backgroundColor;\n }\n\n return withPlugins(config, [\n [withAndroidSplashMainActivity,
|
|
1
|
+
{"version":3,"file":"withAndroidSplashScreen.js","names":["_configPlugins","data","require","_getAndroidSplashConfig","_withAndroidSplashDrawables","_withAndroidSplashImages","_withAndroidSplashMainActivity","_withAndroidSplashStrings","_withAndroidSplashStyles","withAndroidSplashScreen","config","props","isLegacyConfig","undefined","splashConfig","getAndroidSplashConfig","backgroundColor","androidStatusBar","toLowerCase","WarningAggregator","addWarningAndroid","withPlugins","withAndroidSplashMainActivity","withAndroidSplashImages","withAndroidSplashDrawables","withAndroidSplashStyles","withAndroidSplashStrings","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withPlugins } from '@expo/config-plugins';\n\nimport { AndroidSplashConfig, getAndroidSplashConfig } from './getAndroidSplashConfig';\nimport { withAndroidSplashDrawables } from './withAndroidSplashDrawables';\nimport { withAndroidSplashImages } from './withAndroidSplashImages';\nimport { withAndroidSplashMainActivity } from './withAndroidSplashMainActivity';\nimport { withAndroidSplashStrings } from './withAndroidSplashStrings';\nimport { withAndroidSplashStyles } from './withAndroidSplashStyles';\n\nexport const withAndroidSplashScreen: ConfigPlugin<\n AndroidSplashConfig | undefined | null | void\n> = (config, props) => {\n const isLegacyConfig = props === undefined;\n const splashConfig = getAndroidSplashConfig(config, props ?? null);\n\n // Update the android status bar to match the splash screen\n // androidStatusBar applies info to the app activity style.\n const backgroundColor = splashConfig?.backgroundColor || '#ffffff';\n if (config.androidStatusBar?.backgroundColor) {\n if (\n backgroundColor.toLowerCase() !== config.androidStatusBar?.backgroundColor?.toLowerCase?.()\n ) {\n WarningAggregator.addWarningAndroid(\n 'androidStatusBar.backgroundColor',\n 'Color conflicts with the splash.backgroundColor'\n );\n }\n } else {\n if (!config.androidStatusBar) config.androidStatusBar = {};\n config.androidStatusBar.backgroundColor = backgroundColor;\n }\n\n return withPlugins(config, [\n [withAndroidSplashMainActivity, { isLegacyConfig }],\n [withAndroidSplashImages, splashConfig],\n [withAndroidSplashDrawables, splashConfig],\n [withAndroidSplashStyles, { splashConfig, isLegacyConfig }],\n [withAndroidSplashStrings, splashConfig],\n ]);\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eA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E,WAAW,CAAC,CAAC,KAAKR,MAAM,CAACO,gBAAgB,EAAED,eAAe,EAAEE,WAAW,GAAG,CAAC,EAC3F;MACAC,kCAAiB,CAACC,iBAAiB,CACjC,kCAAkC,EAClC,iDACF,CAAC;IACH;EACF,CAAC,MAAM;IACL,IAAI,CAACV,MAAM,CAACO,gBAAgB,EAAEP,MAAM,CAACO,gBAAgB,GAAG,CAAC,CAAC;IAC1DP,MAAM,CAACO,gBAAgB,CAACD,eAAe,GAAGA,eAAe;EAC3D;EAEA,OAAO,IAAAK,4BAAW,EAACX,MAAM,EAAE,CACzB,CAACY,8DAA6B,EAAE;IAAEV;EAAe,CAAC,CAAC,EACnD,CAACW,kDAAuB,EAAET,YAAY,CAAC,EACvC,CAACU,wDAA0B,EAAEV,YAAY,CAAC,EAC1C,CAACW,kDAAuB,EAAE;IAAEX,YAAY;IAAEF;EAAe,CAAC,CAAC,EAC3D,CAACc,oDAAwB,EAAEZ,YAAY,CAAC,CACzC,CAAC;AACJ,CAAC;AAACa,OAAA,CAAAlB,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
|
|
2
2
|
import { ExpoConfig } from '@expo/config-types';
|
|
3
3
|
import { AndroidSplashConfig } from './getAndroidSplashConfig';
|
|
4
|
-
export declare const withAndroidSplashStyles: ConfigPlugin<
|
|
4
|
+
export declare const withAndroidSplashStyles: ConfigPlugin<{
|
|
5
|
+
splashConfig: AndroidSplashConfig | null;
|
|
6
|
+
isLegacyConfig: boolean;
|
|
7
|
+
}>;
|
|
5
8
|
export declare function removeOldSplashStyleGroup(styles: AndroidConfig.Resources.ResourceXML): AndroidConfig.Resources.ResourceXML;
|
|
6
9
|
export declare function getSplashBackgroundColor(config: ExpoConfig, props: AndroidSplashConfig | null): string | null;
|
|
7
10
|
export declare function getSplashDarkBackgroundColor(config: ExpoConfig, props: AndroidSplashConfig | null): string | null;
|
|
@@ -35,9 +35,12 @@ const styleResourceGroup = {
|
|
|
35
35
|
parent: 'Theme.SplashScreen'
|
|
36
36
|
};
|
|
37
37
|
const SPLASH_COLOR_NAME = 'splashscreen_background';
|
|
38
|
-
const withAndroidSplashStyles = (config,
|
|
38
|
+
const withAndroidSplashStyles = (config, {
|
|
39
|
+
splashConfig,
|
|
40
|
+
isLegacyConfig
|
|
41
|
+
}) => {
|
|
39
42
|
config = (0, _configPlugins().withAndroidColors)(config, config => {
|
|
40
|
-
const backgroundColor = getSplashBackgroundColor(config,
|
|
43
|
+
const backgroundColor = getSplashBackgroundColor(config, splashConfig);
|
|
41
44
|
if (!backgroundColor) {
|
|
42
45
|
return config;
|
|
43
46
|
}
|
|
@@ -45,7 +48,7 @@ const withAndroidSplashStyles = (config, props) => {
|
|
|
45
48
|
return config;
|
|
46
49
|
});
|
|
47
50
|
config = (0, _configPlugins().withAndroidColorsNight)(config, config => {
|
|
48
|
-
const backgroundColor = getSplashDarkBackgroundColor(config,
|
|
51
|
+
const backgroundColor = getSplashDarkBackgroundColor(config, splashConfig);
|
|
49
52
|
if (!backgroundColor) {
|
|
50
53
|
return config;
|
|
51
54
|
}
|
|
@@ -54,7 +57,7 @@ const withAndroidSplashStyles = (config, props) => {
|
|
|
54
57
|
});
|
|
55
58
|
config = (0, _configPlugins().withAndroidStyles)(config, config => {
|
|
56
59
|
config.modResults = removeOldSplashStyleGroup(config.modResults);
|
|
57
|
-
config.modResults = addSplashScreenStyle(config.modResults);
|
|
60
|
+
config.modResults = addSplashScreenStyle(config.modResults, isLegacyConfig);
|
|
58
61
|
return config;
|
|
59
62
|
});
|
|
60
63
|
return config;
|
|
@@ -62,34 +65,45 @@ const withAndroidSplashStyles = (config, props) => {
|
|
|
62
65
|
|
|
63
66
|
// Add the style that extends Theme.SplashScreen
|
|
64
67
|
exports.withAndroidSplashStyles = withAndroidSplashStyles;
|
|
65
|
-
function addSplashScreenStyle(styles) {
|
|
68
|
+
function addSplashScreenStyle(styles, isLegacyConfig) {
|
|
66
69
|
const {
|
|
67
70
|
resources
|
|
68
71
|
} = styles;
|
|
69
72
|
const {
|
|
70
73
|
style = []
|
|
71
74
|
} = resources;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
let item;
|
|
76
|
+
if (isLegacyConfig) {
|
|
77
|
+
item = [{
|
|
78
|
+
$: {
|
|
79
|
+
name: 'android:windowBackground'
|
|
80
|
+
},
|
|
81
|
+
_: '@drawable/ic_launcher_background'
|
|
82
|
+
}];
|
|
83
|
+
} else {
|
|
84
|
+
item = [{
|
|
85
|
+
$: {
|
|
86
|
+
name: 'windowSplashScreenBackground'
|
|
87
|
+
},
|
|
88
|
+
_: '@color/splashscreen_background'
|
|
89
|
+
}, {
|
|
90
|
+
$: {
|
|
91
|
+
name: 'windowSplashScreenAnimatedIcon'
|
|
92
|
+
},
|
|
93
|
+
_: '@drawable/splashscreen_logo'
|
|
94
|
+
}, {
|
|
95
|
+
$: {
|
|
96
|
+
name: 'postSplashScreenTheme'
|
|
97
|
+
},
|
|
98
|
+
_: '@style/AppTheme'
|
|
99
|
+
}];
|
|
100
|
+
}
|
|
88
101
|
styles.resources.style = [...style.filter(({
|
|
89
102
|
$
|
|
90
103
|
}) => $.name !== 'Theme.App.SplashScreen'), {
|
|
91
104
|
$: {
|
|
92
|
-
...styleResourceGroup
|
|
105
|
+
...styleResourceGroup,
|
|
106
|
+
parent: isLegacyConfig ? 'AppTheme' : 'Theme.SplashScreen'
|
|
93
107
|
},
|
|
94
108
|
item
|
|
95
109
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashStyles.js","names":["_configPlugins","data","require","_android","_getAndroidSplashConfig","styleResourceGroup","name","parent","SPLASH_COLOR_NAME","withAndroidSplashStyles","config","
|
|
1
|
+
{"version":3,"file":"withAndroidSplashStyles.js","names":["_configPlugins","data","require","_android","_getAndroidSplashConfig","styleResourceGroup","name","parent","SPLASH_COLOR_NAME","withAndroidSplashStyles","config","splashConfig","isLegacyConfig","withAndroidColors","backgroundColor","getSplashBackgroundColor","modResults","setSplashColorsForTheme","withAndroidColorsNight","getSplashDarkBackgroundColor","withAndroidStyles","removeOldSplashStyleGroup","addSplashScreenStyle","exports","styles","resources","style","item","$","_","filter","group","head","matches","props","getAndroidSplashConfig","getAndroidDarkSplashConfig","setSplashStylesForTheme","AndroidConfig","Styles","assignStylesValue","add","value","colors","Colors","assignColorValue"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { Colors } from '@expo/config-plugins/build/android';\nimport { ExpoConfig } from '@expo/config-types';\n\nimport {\n AndroidSplashConfig,\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n} from './getAndroidSplashConfig';\n\nconst styleResourceGroup = {\n name: 'Theme.App.SplashScreen',\n parent: 'Theme.SplashScreen',\n};\n\nconst SPLASH_COLOR_NAME = 'splashscreen_background';\n\nexport const withAndroidSplashStyles: ConfigPlugin<{\n splashConfig: AndroidSplashConfig | null;\n isLegacyConfig: boolean;\n}> = (config, { splashConfig, isLegacyConfig }) => {\n config = withAndroidColors(config, (config) => {\n const backgroundColor = getSplashBackgroundColor(config, splashConfig);\n if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidColorsNight(config, (config) => {\n const backgroundColor = getSplashDarkBackgroundColor(config, splashConfig);\n if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidStyles(config, (config) => {\n config.modResults = removeOldSplashStyleGroup(config.modResults);\n config.modResults = addSplashScreenStyle(config.modResults, isLegacyConfig);\n return config;\n });\n return config;\n};\n\n// Add the style that extends Theme.SplashScreen\nfunction addSplashScreenStyle(\n styles: AndroidConfig.Resources.ResourceXML,\n isLegacyConfig: boolean\n) {\n const { resources } = styles;\n const { style = [] } = resources;\n\n let item;\n if (isLegacyConfig) {\n item = [\n {\n $: { name: 'android:windowBackground' },\n _: '@drawable/ic_launcher_background',\n },\n ];\n } else {\n item = [\n {\n $: { name: 'windowSplashScreenBackground' },\n _: '@color/splashscreen_background',\n },\n {\n $: { name: 'windowSplashScreenAnimatedIcon' },\n _: '@drawable/splashscreen_logo',\n },\n {\n $: { name: 'postSplashScreenTheme' },\n _: '@style/AppTheme',\n },\n ];\n }\n\n styles.resources.style = [\n ...style.filter(({ $ }) => $.name !== 'Theme.App.SplashScreen'),\n {\n $: {\n ...styleResourceGroup,\n parent: isLegacyConfig ? 'AppTheme' : 'Theme.SplashScreen',\n },\n item,\n },\n ];\n\n return styles;\n}\n\n// Remove the old style group which didn't extend the base theme properly.\nexport function removeOldSplashStyleGroup(styles: AndroidConfig.Resources.ResourceXML) {\n const group = {\n name: 'Theme.App.SplashScreen',\n parent: 'Theme.AppCompat.Light.NoActionBar',\n };\n\n styles.resources.style = styles.resources.style?.filter?.(({ $: head }) => {\n let matches = head.name === group.name;\n if (group.parent != null && matches) {\n matches = head.parent === group.parent;\n }\n return !matches;\n });\n\n return styles;\n}\n\nexport function getSplashBackgroundColor(\n config: ExpoConfig,\n props: AndroidSplashConfig | null\n): string | null {\n return getAndroidSplashConfig(config, props)?.backgroundColor ?? null;\n}\n\nexport function getSplashDarkBackgroundColor(\n config: ExpoConfig,\n props: AndroidSplashConfig | null\n): string | null {\n return getAndroidDarkSplashConfig(config, props)?.backgroundColor ?? null;\n}\n\nexport function setSplashStylesForTheme(styles: AndroidConfig.Resources.ResourceXML) {\n // Add splash screen image\n return AndroidConfig.Styles.assignStylesValue(styles, {\n add: true,\n value: '@drawable/splashscreen_logo',\n name: 'android:windowSplashScreenBackground',\n parent: styleResourceGroup,\n });\n}\n\nexport function setSplashColorsForTheme(\n colors: AndroidConfig.Resources.ResourceXML,\n backgroundColor: string | null\n): AndroidConfig.Resources.ResourceXML {\n return Colors.assignColorValue(colors, { value: backgroundColor, name: SPLASH_COLOR_NAME });\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,wBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,uBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,MAAMI,kBAAkB,GAAG;EACzBC,IAAI,EAAE,wBAAwB;EAC9BC,MAAM,EAAE;AACV,CAAC;AAED,MAAMC,iBAAiB,GAAG,yBAAyB;AAE5C,MAAMC,uBAGX,GAAGA,CAACC,MAAM,EAAE;EAAEC,YAAY;EAAEC;AAAe,CAAC,KAAK;EACjDF,MAAM,GAAG,IAAAG,kCAAiB,EAACH,MAAM,EAAGA,MAAM,IAAK;IAC7C,MAAMI,eAAe,GAAGC,wBAAwB,CAACL,MAAM,EAAEC,YAAY,CAAC;IACtE,IAAI,CAACG,eAAe,EAAE;MACpB,OAAOJ,MAAM;IACf;IACAA,MAAM,CAACM,UAAU,GAAGC,uBAAuB,CAACP,MAAM,CAACM,UAAU,EAAEF,eAAe,CAAC;IAC/E,OAAOJ,MAAM;EACf,CAAC,CAAC;EACFA,MAAM,GAAG,IAAAQ,uCAAsB,EAACR,MAAM,EA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ACC,iBAAiB,CAAChB,MAAM,EAAE;IACpDiB,GAAG,EAAE,IAAI;IACTC,KAAK,EAAE,6BAA6B;IACpCpC,IAAI,EAAE,sCAAsC;IAC5CC,MAAM,EAAEF;EACV,CAAC,CAAC;AACJ;AAEO,SAASY,uBAAuBA,CACrC0B,MAA2C,EAC3C7B,eAA8B,EACO;EACrC,OAAO8B,iBAAM,CAACC,gBAAgB,CAACF,MAAM,EAAE;IAAED,KAAK,EAAE5B,eAAe;IAAER,IAAI,EAAEE;EAAkB,CAAC,CAAC;AAC7F","ignoreList":[]}
|
|
@@ -71,11 +71,11 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
71
71
|
const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:ios');
|
|
72
72
|
const withIosSplashScreen = (config, props) => {
|
|
73
73
|
// If the user didn't specify a splash object, infer the splash object from the Expo config.
|
|
74
|
-
|
|
74
|
+
const splashConfig = (0, _getIosSplashConfig().getIosSplashConfig)(config, props ?? null);
|
|
75
75
|
debug(`config:`, props);
|
|
76
|
-
return (0, _configPlugins().withPlugins)(config, [[_withIosSplashInfoPlist().withIosSplashInfoPlist,
|
|
76
|
+
return (0, _configPlugins().withPlugins)(config, [[_withIosSplashInfoPlist().withIosSplashInfoPlist, splashConfig], [_withIosSplashAssets().withIosSplashAssets, splashConfig], [_withIosSplashColors().withIosSplashColors, splashConfig],
|
|
77
77
|
// Add the image settings to the storyboard.
|
|
78
|
-
[_withIosSplashScreenStoryboardImage().withIosSplashScreenImage,
|
|
78
|
+
[_withIosSplashScreenStoryboardImage().withIosSplashScreenImage, splashConfig],
|
|
79
79
|
// Link storyboard to xcode project.
|
|
80
80
|
// TODO: Maybe fold this into the base mod.
|
|
81
81
|
_withIosSplashXcodeProject().withIosSplashXcodeProject,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosSplashScreen.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","_getIosSplashConfig","_withIosSplashAssets","_withIosSplashColors","_withIosSplashInfoPlist","_withIosSplashScreenStoryboard","_withIosSplashScreenStoryboardImage","_withIosSplashXcodeProject","e","__esModule","default","debug","Debug","withIosSplashScreen","config","props","getIosSplashConfig","withPlugins","withIosSplashInfoPlist","withIosSplashAssets","withIosSplashColors","withIosSplashScreenImage","withIosSplashXcodeProject","withIosSplashScreenStoryboardBaseMod","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\nimport Debug from 'debug';\n\nimport { getIosSplashConfig, IOSSplashConfig } from './getIosSplashConfig';\nimport { withIosSplashAssets } from './withIosSplashAssets';\nimport { withIosSplashColors } from './withIosSplashColors';\nimport { withIosSplashInfoPlist } from './withIosSplashInfoPlist';\nimport { withIosSplashScreenStoryboardBaseMod } from './withIosSplashScreenStoryboard';\nimport { withIosSplashScreenImage } from './withIosSplashScreenStoryboardImage';\nimport { withIosSplashXcodeProject } from './withIosSplashXcodeProject';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios');\n\nexport const withIosSplashScreen: ConfigPlugin<IOSSplashConfig | undefined | null | void> = (\n config,\n props\n) => {\n // If the user didn't specify a splash object, infer the splash object from the Expo config.\n
|
|
1
|
+
{"version":3,"file":"withIosSplashScreen.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","_getIosSplashConfig","_withIosSplashAssets","_withIosSplashColors","_withIosSplashInfoPlist","_withIosSplashScreenStoryboard","_withIosSplashScreenStoryboardImage","_withIosSplashXcodeProject","e","__esModule","default","debug","Debug","withIosSplashScreen","config","props","splashConfig","getIosSplashConfig","withPlugins","withIosSplashInfoPlist","withIosSplashAssets","withIosSplashColors","withIosSplashScreenImage","withIosSplashXcodeProject","withIosSplashScreenStoryboardBaseMod","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\nimport Debug from 'debug';\n\nimport { getIosSplashConfig, IOSSplashConfig } from './getIosSplashConfig';\nimport { withIosSplashAssets } from './withIosSplashAssets';\nimport { withIosSplashColors } from './withIosSplashColors';\nimport { withIosSplashInfoPlist } from './withIosSplashInfoPlist';\nimport { withIosSplashScreenStoryboardBaseMod } from './withIosSplashScreenStoryboard';\nimport { withIosSplashScreenImage } from './withIosSplashScreenStoryboardImage';\nimport { withIosSplashXcodeProject } from './withIosSplashXcodeProject';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios');\n\nexport const withIosSplashScreen: ConfigPlugin<IOSSplashConfig | undefined | null | void> = (\n config,\n props\n) => {\n // If the user didn't specify a splash object, infer the splash object from the Expo config.\n const splashConfig = getIosSplashConfig(config, props ?? null);\n\n debug(`config:`, props);\n\n return withPlugins(config, [\n [withIosSplashInfoPlist, splashConfig],\n [withIosSplashAssets, splashConfig],\n [withIosSplashColors, splashConfig],\n // Add the image settings to the storyboard.\n [withIosSplashScreenImage, splashConfig],\n // Link storyboard to xcode project.\n // TODO: Maybe fold this into the base mod.\n withIosSplashXcodeProject,\n // Insert the base mod last, no other ios.splashScreenStoryboard mods can be added after this.\n withIosSplashScreenStoryboardBaseMod,\n ]);\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,oBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,mBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,qBAAA;EAAA,MAAAL,IAAA,G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AC,EACnC,CAACK,0CAAmB,EAAEL,YAAY,CAAC;EACnC;EACA,CAACM,8DAAwB,EAAEN,YAAY,CAAC;EACxC;EACA;EACAO,sDAAyB;EACzB;EACAC,qEAAoC,CACrC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAZ,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/prebuild-config",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.13",
|
|
4
4
|
"description": "Get the prebuild config",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "68c2c4f5a536c4eb7db9551188c7f667d9fa53c8"
|
|
56
56
|
}
|