@expo/prebuild-config 5.0.7 → 6.0.0

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.
Files changed (113) hide show
  1. package/build/getAutolinkedPackages.js +3 -13
  2. package/build/getAutolinkedPackages.js.map +1 -1
  3. package/build/getPrebuildConfig.js +9 -24
  4. package/build/getPrebuildConfig.js.map +1 -1
  5. package/build/importExpoModulesAutolinking.d.ts +3 -3
  6. package/build/importExpoModulesAutolinking.js +0 -5
  7. package/build/importExpoModulesAutolinking.js.map +1 -1
  8. package/build/index.js +0 -5
  9. package/build/index.js.map +1 -1
  10. package/build/plugins/icons/AssetContents.d.ts +3 -3
  11. package/build/plugins/icons/AssetContents.js +1 -10
  12. package/build/plugins/icons/AssetContents.js.map +1 -1
  13. package/build/plugins/icons/withAndroidIcons.d.ts +7 -5
  14. package/build/plugins/icons/withAndroidIcons.js +52 -71
  15. package/build/plugins/icons/withAndroidIcons.js.map +1 -1
  16. package/build/plugins/icons/withAndroidManifestIcons.js +0 -10
  17. package/build/plugins/icons/withAndroidManifestIcons.js.map +1 -1
  18. package/build/plugins/icons/withIosIcons.js +24 -48
  19. package/build/plugins/icons/withIosIcons.js.map +1 -1
  20. package/build/plugins/unversioned/createLegacyPlugin.js +0 -11
  21. package/build/plugins/unversioned/createLegacyPlugin.js.map +1 -1
  22. package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js +0 -11
  23. package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js.map +1 -1
  24. package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js +0 -14
  25. package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js.map +1 -1
  26. package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js +5 -14
  27. package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js.map +1 -1
  28. package/build/plugins/unversioned/expo-apple-authentication.js +0 -11
  29. package/build/plugins/unversioned/expo-apple-authentication.js.map +1 -1
  30. package/build/plugins/unversioned/expo-branch/expo-branch.js +4 -13
  31. package/build/plugins/unversioned/expo-branch/expo-branch.js.map +1 -1
  32. package/build/plugins/unversioned/expo-branch/withAndroidBranch.js +0 -12
  33. package/build/plugins/unversioned/expo-branch/withAndroidBranch.js.map +1 -1
  34. package/build/plugins/unversioned/expo-branch/withIosBranch.js +2 -11
  35. package/build/plugins/unversioned/expo-branch/withIosBranch.js.map +1 -1
  36. package/build/plugins/unversioned/expo-contacts.js +2 -13
  37. package/build/plugins/unversioned/expo-contacts.js.map +1 -1
  38. package/build/plugins/unversioned/expo-document-picker.js +2 -12
  39. package/build/plugins/unversioned/expo-document-picker.js.map +1 -1
  40. package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js +2 -9
  41. package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js.map +1 -1
  42. package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js +0 -20
  43. package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js.map +1 -1
  44. package/build/plugins/unversioned/expo-notifications/expo-notifications.js +4 -14
  45. package/build/plugins/unversioned/expo-notifications/expo-notifications.js.map +1 -1
  46. package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.d.ts +1 -1
  47. package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.js +1 -44
  48. package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.js.map +1 -1
  49. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.d.ts +20 -20
  50. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js +14 -33
  51. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js.map +1 -1
  52. package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js +0 -11
  53. package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js.map +1 -1
  54. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.d.ts +1 -1
  55. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js +2 -11
  56. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js.map +1 -1
  57. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.d.ts +1 -2
  58. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js +0 -26
  59. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js.map +1 -1
  60. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js +4 -9
  61. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js.map +1 -1
  62. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js +9 -36
  63. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
  64. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js +13 -34
  65. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map +1 -1
  66. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js +4 -46
  67. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js.map +1 -1
  68. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js +0 -13
  69. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js.map +1 -1
  70. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js +2 -23
  71. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js.map +1 -1
  72. package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js +16 -54
  73. package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js.map +1 -1
  74. package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js +6 -22
  75. package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js.map +1 -1
  76. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js +7 -35
  77. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js.map +1 -1
  78. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js +9 -33
  79. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js.map +1 -1
  80. package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js +1 -18
  81. package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js.map +1 -1
  82. package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js +2 -15
  83. package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js.map +1 -1
  84. package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js +0 -17
  85. package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js.map +1 -1
  86. package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js +0 -14
  87. package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js.map +1 -1
  88. package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js +2 -9
  89. package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js.map +1 -1
  90. package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js +2 -27
  91. package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js.map +1 -1
  92. package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js +2 -14
  93. package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js.map +1 -1
  94. package/build/plugins/unversioned/expo-updates.js +1 -8
  95. package/build/plugins/unversioned/expo-updates.js.map +1 -1
  96. package/build/plugins/unversioned/react-native-maps.js +4 -19
  97. package/build/plugins/unversioned/react-native-maps.js.map +1 -1
  98. package/build/plugins/withDefaultPlugins.d.ts +2 -2
  99. package/build/plugins/withDefaultPlugins.js +41 -94
  100. package/build/plugins/withDefaultPlugins.js.map +1 -1
  101. package/package.json +6 -6
  102. package/build/plugins/unversioned/expo-facebook/expo-facebook.d.ts +0 -2
  103. package/build/plugins/unversioned/expo-facebook/expo-facebook.js +0 -57
  104. package/build/plugins/unversioned/expo-facebook/expo-facebook.js.map +0 -1
  105. package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.d.ts +0 -13
  106. package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.js +0 -235
  107. package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.js.map +0 -1
  108. package/build/plugins/unversioned/expo-facebook/withIosFacebook.d.ts +0 -26
  109. package/build/plugins/unversioned/expo-facebook/withIosFacebook.js +0 -233
  110. package/build/plugins/unversioned/expo-facebook/withIosFacebook.js.map +0 -1
  111. package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.d.ts +0 -9
  112. package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.js +0 -69
  113. package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { ExpoConfig } from '@expo/config-types';
2
- export declare type SplashScreenConfig = {
2
+ export type SplashScreenConfig = {
3
3
  xxxhdpi: string | null;
4
4
  xxhdpi: string | null;
5
5
  xhdpi: string | null;
@@ -6,15 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getAndroidDarkSplashConfig = getAndroidDarkSplashConfig;
7
7
  exports.getAndroidSplashConfig = getAndroidSplashConfig;
8
8
  const defaultResizeMode = 'contain';
9
-
10
9
  function getAndroidSplashConfig(config) {
11
10
  var _config$android;
12
-
13
11
  // Respect the splash screen object, don't mix and match across different splash screen objects
14
12
  // in case the user wants the top level splash to apply to every platform except android.
15
13
  if ((_config$android = config.android) !== null && _config$android !== void 0 && _config$android.splash) {
16
14
  var _config$android2, _ref, _splash$xxxhdpi, _ref2, _splash$xxhdpi, _ref3, _splash$xhdpi, _ref4, _splash$hdpi, _ref5, _splash$mdpi, _splash$backgroundCol, _splash$resizeMode;
17
-
18
15
  const splash = (_config$android2 = config.android) === null || _config$android2 === void 0 ? void 0 : _config$android2.splash;
19
16
  return {
20
17
  xxxhdpi: (_ref = (_splash$xxxhdpi = splash.xxxhdpi) !== null && _splash$xxxhdpi !== void 0 ? _splash$xxxhdpi : splash.image) !== null && _ref !== void 0 ? _ref : null,
@@ -26,10 +23,8 @@ function getAndroidSplashConfig(config) {
26
23
  resizeMode: (_splash$resizeMode = splash.resizeMode) !== null && _splash$resizeMode !== void 0 ? _splash$resizeMode : defaultResizeMode
27
24
  };
28
25
  }
29
-
30
26
  if (config.splash) {
31
27
  var _splash$image, _splash$image2, _splash$image3, _splash$image4, _splash$image5, _splash$backgroundCol2, _splash$resizeMode2;
32
-
33
28
  const splash = config.splash;
34
29
  return {
35
30
  xxxhdpi: (_splash$image = splash.image) !== null && _splash$image !== void 0 ? _splash$image : null,
@@ -41,19 +36,16 @@ function getAndroidSplashConfig(config) {
41
36
  resizeMode: (_splash$resizeMode2 = splash.resizeMode) !== null && _splash$resizeMode2 !== void 0 ? _splash$resizeMode2 : defaultResizeMode
42
37
  };
43
38
  }
44
-
45
39
  return null;
46
- } // TODO: dark isn't supported in the Expo config spec yet.
47
-
40
+ }
48
41
 
42
+ // TODO: dark isn't supported in the Expo config spec yet.
49
43
  function getAndroidDarkSplashConfig(config) {
50
44
  var _config$android3, _config$android3$spla;
51
-
52
45
  // Respect the splash screen object, don't mix and match across different splash screen objects
53
46
  // in case the user wants the top level splash to apply to every platform except android.
54
47
  if ((_config$android3 = config.android) !== null && _config$android3 !== void 0 && (_config$android3$spla = _config$android3.splash) !== null && _config$android3$spla !== void 0 && _config$android3$spla.dark) {
55
48
  var _config$android4, _config$android4$spla, _ref6, _splash$xxxhdpi2, _ref7, _splash$xxhdpi2, _ref8, _splash$xhdpi2, _ref9, _splash$hdpi2, _ref10, _splash$mdpi2, _splash$backgroundCol3, _lightTheme$resizeMod;
56
-
57
49
  const splash = (_config$android4 = config.android) === null || _config$android4 === void 0 ? void 0 : (_config$android4$spla = _config$android4.splash) === null || _config$android4$spla === void 0 ? void 0 : _config$android4$spla.dark;
58
50
  const lightTheme = getAndroidSplashConfig(config);
59
51
  return {
@@ -67,7 +59,6 @@ function getAndroidDarkSplashConfig(config) {
67
59
  resizeMode: (_lightTheme$resizeMod = lightTheme === null || lightTheme === void 0 ? void 0 : lightTheme.resizeMode) !== null && _lightTheme$resizeMod !== void 0 ? _lightTheme$resizeMod : defaultResizeMode
68
60
  };
69
61
  }
70
-
71
62
  return null;
72
63
  }
73
64
  //# sourceMappingURL=getAndroidSplashConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getAndroidSplashConfig.js","names":["defaultResizeMode","getAndroidSplashConfig","config","android","splash","xxxhdpi","image","xxhdpi","xhdpi","hdpi","mdpi","backgroundColor","resizeMode","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 | null;\n xxhdpi: string | null;\n xhdpi: string | null;\n hdpi: string | null;\n mdpi: string | null;\n backgroundColor: string | null;\n resizeMode: 'contain' | 'cover' | 'native';\n};\n\nconst defaultResizeMode = 'contain';\n\nexport function getAndroidSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>\n): SplashScreenConfig | 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 (config.android?.splash) {\n const splash = config.android?.splash;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,\n xxhdpi: splash.xxhdpi ?? splash.image ?? null,\n xhdpi: splash.xhdpi ?? splash.image ?? null,\n hdpi: splash.hdpi ?? splash.image ?? null,\n mdpi: splash.mdpi ?? splash.image ?? null,\n backgroundColor: splash.backgroundColor ?? null,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n return {\n xxxhdpi: splash.image ?? null,\n xxhdpi: splash.image ?? null,\n xhdpi: splash.image ?? null,\n hdpi: splash.image ?? null,\n mdpi: splash.image ?? null,\n backgroundColor: splash.backgroundColor ?? null,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n };\n }\n\n return null;\n}\n\n// TODO: dark isn't supported in the Expo config spec yet.\nexport function getAndroidDarkSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>\n): SplashScreenConfig | 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 (config.android?.splash?.dark) {\n const splash = config.android?.splash?.dark;\n const lightTheme = getAndroidSplashConfig(config);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,\n xxhdpi: splash.xxhdpi ?? splash.image ?? null,\n xhdpi: splash.xhdpi ?? splash.image ?? null,\n hdpi: splash.hdpi ?? splash.image ?? null,\n mdpi: splash.mdpi ?? splash.image ?? null,\n backgroundColor: splash.backgroundColor ?? null,\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":";;;;;;;AAYA,MAAMA,iBAAiB,GAAG,SAA1B;;AAEO,SAASC,sBAAT,CACLC,MADK,EAEsB;EAAA;;EAC3B;EACA;EACA,uBAAIA,MAAM,CAACC,OAAX,4CAAI,gBAAgBC,MAApB,EAA4B;IAAA;;IAC1B,MAAMA,MAAM,uBAAGF,MAAM,CAACC,OAAV,qDAAG,iBAAgBC,MAA/B;IACA,OAAO;MACLC,OAAO,6BAAED,MAAM,CAACC,OAAT,6DAAoBD,MAAM,CAACE,KAA3B,uCAAoC,IADtC;MAELC,MAAM,6BAAEH,MAAM,CAACG,MAAT,2DAAmBH,MAAM,CAACE,KAA1B,yCAAmC,IAFpC;MAGLE,KAAK,4BAAEJ,MAAM,CAACI,KAAT,yDAAkBJ,MAAM,CAACE,KAAzB,yCAAkC,IAHlC;MAILG,IAAI,2BAAEL,MAAM,CAACK,IAAT,uDAAiBL,MAAM,CAACE,KAAxB,yCAAiC,IAJhC;M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AACI,KAAT,2DAAkBJ,MAAM,CAACE,KAAzB,yCAAkC,IAHlC;MAILG,IAAI,4BAAEL,MAAM,CAACK,IAAT,yDAAiBL,MAAM,CAACE,KAAxB,yCAAiC,IAJhC;MAKLI,IAAI,6BAAEN,MAAM,CAACM,IAAT,yDAAiBN,MAAM,CAACE,KAAxB,2CAAiC,IALhC;MAMLK,eAAe,4BAAEP,MAAM,CAACO,eAAT,2EAA4B,IANtC;MAOL;MACAC,UAAU,2BAAEG,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAEH,UAAd,yEAA4BZ;IARjC,CAAP;EAUD;;EAED,OAAO,IAAP;AACD"}
1
+ {"version":3,"file":"getAndroidSplashConfig.js","names":["defaultResizeMode","getAndroidSplashConfig","config","android","splash","xxxhdpi","image","xxhdpi","xhdpi","hdpi","mdpi","backgroundColor","resizeMode","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 | null;\n xxhdpi: string | null;\n xhdpi: string | null;\n hdpi: string | null;\n mdpi: string | null;\n backgroundColor: string | null;\n resizeMode: 'contain' | 'cover' | 'native';\n};\n\nconst defaultResizeMode = 'contain';\n\nexport function getAndroidSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>\n): SplashScreenConfig | 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 (config.android?.splash) {\n const splash = config.android?.splash;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,\n xxhdpi: splash.xxhdpi ?? splash.image ?? null,\n xhdpi: splash.xhdpi ?? splash.image ?? null,\n hdpi: splash.hdpi ?? splash.image ?? null,\n mdpi: splash.mdpi ?? splash.image ?? null,\n backgroundColor: splash.backgroundColor ?? null,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n return {\n xxxhdpi: splash.image ?? null,\n xxhdpi: splash.image ?? null,\n xhdpi: splash.image ?? null,\n hdpi: splash.image ?? null,\n mdpi: splash.image ?? null,\n backgroundColor: splash.backgroundColor ?? null,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n };\n }\n\n return null;\n}\n\n// TODO: dark isn't supported in the Expo config spec yet.\nexport function getAndroidDarkSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>\n): SplashScreenConfig | 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 (config.android?.splash?.dark) {\n const splash = config.android?.splash?.dark;\n const lightTheme = getAndroidSplashConfig(config);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,\n xxhdpi: splash.xxhdpi ?? splash.image ?? null,\n xhdpi: splash.xhdpi ?? splash.image ?? null,\n hdpi: splash.hdpi ?? splash.image ?? null,\n mdpi: splash.mdpi ?? splash.image ?? null,\n backgroundColor: splash.backgroundColor ?? null,\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":";;;;;;;AAYA,MAAMA,iBAAiB,GAAG,SAAS;AAE5B,SAASC,sBAAsB,CACpCC,MAA8C,EACnB;EAAA;EAC3B;EACA;EACA,uBAAIA,MAAM,CAACC,OAAO,4CAAd,gBAAgBC,MAAM,EAAE;IAAA;IAC1B,MAAMA,MAAM,uBAAGF,MAAM,CAACC,OAAO,qDAAd,iBAAgBC,MAAM;IACrC,OAAO;MACLC,OAAO,6BAAED,MAAM,CAACC,OAAO,6DAAID,MAAM,CAACE,KAAK,uCAAI,IAAI;MAC/CC,MAAM,6BAAEH,MAAM,CAACG,MAAM,2DAAIH,MAAM,CAACE,KAAK,yCAAI,IAAI;MAC7CE,KAAK,4BAAEJ,MAAM,CAACI,KAAK,yDAAIJ,MAAM,CA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AM,CAACG,MAAM,6DAAIH,MAAM,CAACE,KAAK,yCAAI,IAAI;MAC7CE,KAAK,6BAAEJ,MAAM,CAACI,KAAK,2DAAIJ,MAAM,CAACE,KAAK,yCAAI,IAAI;MAC3CG,IAAI,4BAAEL,MAAM,CAACK,IAAI,yDAAIL,MAAM,CAACE,KAAK,yCAAI,IAAI;MACzCI,IAAI,6BAAEN,MAAM,CAACM,IAAI,yDAAIN,MAAM,CAACE,KAAK,2CAAI,IAAI;MACzCK,eAAe,4BAAEP,MAAM,CAACO,eAAe,2EAAI,IAAI;MAC/C;MACAC,UAAU,2BAAEG,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEH,UAAU,yEAAIZ;IACxC,CAAC;EACH;EAEA,OAAO,IAAI;AACb"}
@@ -1,5 +1,5 @@
1
1
  import { ExpoConfig } from '@expo/config-types';
2
- declare type ExpoConfigIosSplash = NonNullable<NonNullable<ExpoConfig['ios']>['splash']>;
2
+ type ExpoConfigIosSplash = NonNullable<NonNullable<ExpoConfig['ios']>['splash']>;
3
3
  export interface IOSSplashConfig {
4
4
  image?: string | null;
5
5
  backgroundColor: string;
@@ -14,5 +14,4 @@ export interface IOSSplashConfig {
14
14
  };
15
15
  }
16
16
  export declare function getIosSplashConfig(config: ExpoConfig): IOSSplashConfig | null;
17
- export declare function warnUnsupportedSplashProperties(config: ExpoConfig): void;
18
17
  export {};
@@ -4,30 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getIosSplashConfig = getIosSplashConfig;
7
- exports.warnUnsupportedSplashProperties = warnUnsupportedSplashProperties;
8
-
9
- function _configPlugins() {
10
- const data = require("@expo/config-plugins");
11
-
12
- _configPlugins = function () {
13
- return data;
14
- };
15
-
16
- return data;
17
- }
18
-
19
7
  const defaultResizeMode = 'contain';
20
8
  const defaultBackgroundColor = '#ffffff';
21
-
22
9
  // TODO: Maybe use an array on splash with theme value. Then remove the array in serialization for legacy and manifest.
23
10
  function getIosSplashConfig(config) {
24
11
  var _config$ios;
25
-
26
12
  // Respect the splash screen object, don't mix and match across different splash screen objects
27
13
  // in case the user wants the top level splash to apply to every platform except iOS.
28
14
  if ((_config$ios = config.ios) !== null && _config$ios !== void 0 && _config$ios.splash) {
29
15
  var _config$ios2, _splash$image, _splash$resizeMode, _splash$backgroundCol, _splash$tabletImage, _splash$dark$image, _splash$dark, _splash$dark2, _splash$dark$tabletIm, _splash$dark3, _splash$dark4;
30
-
31
16
  const splash = (_config$ios2 = config.ios) === null || _config$ios2 === void 0 ? void 0 : _config$ios2.splash;
32
17
  const image = (_splash$image = splash.image) !== null && _splash$image !== void 0 ? _splash$image : null;
33
18
  return {
@@ -44,10 +29,8 @@ function getIosSplashConfig(config) {
44
29
  }
45
30
  };
46
31
  }
47
-
48
32
  if (config.splash) {
49
33
  var _splash$image2, _splash$resizeMode2, _splash$backgroundCol2;
50
-
51
34
  const splash = config.splash;
52
35
  const image = (_splash$image2 = splash.image) !== null && _splash$image2 !== void 0 ? _splash$image2 : null;
53
36
  return {
@@ -64,7 +47,6 @@ function getIosSplashConfig(config) {
64
47
  }
65
48
  };
66
49
  }
67
-
68
50
  return {
69
51
  backgroundColor: '#ffffff',
70
52
  resizeMode: 'contain',
@@ -72,12 +54,4 @@ function getIosSplashConfig(config) {
72
54
  tabletBackgroundColor: null
73
55
  };
74
56
  }
75
-
76
- function warnUnsupportedSplashProperties(config) {
77
- var _config$ios3, _config$ios3$splash;
78
-
79
- if ((_config$ios3 = config.ios) !== null && _config$ios3 !== void 0 && (_config$ios3$splash = _config$ios3.splash) !== null && _config$ios3$splash !== void 0 && _config$ios3$splash.xib) {
80
- _configPlugins().WarningAggregator.addWarningIOS('ios.splash.xib', 'property is not supported in prebuild. Please use ios.splash.image instead.');
81
- }
82
- }
83
57
  //# sourceMappingURL=getIosSplashConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getIosSplashConfig.js","names":["defaultResizeMode","defaultBackgroundColor","getIosSplashConfig","config","ios","splash","image","resizeMode","backgroundColor","tabletImage","tabletBackgroundColor","dark","warnUnsupportedSplashProperties","xib","WarningAggregator","addWarningIOS"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/getIosSplashConfig.ts"],"sourcesContent":["import { WarningAggregator } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\ntype ExpoConfigIosSplash = NonNullable<NonNullable<ExpoConfig['ios']>['splash']>;\n\nconst defaultResizeMode = 'contain';\nconst defaultBackgroundColor = '#ffffff';\n\nexport interface IOSSplashConfig {\n image?: string | null;\n // tabletImage: string | null;\n backgroundColor: string;\n resizeMode: NonNullable<ExpoConfigIosSplash['resizeMode']>;\n tabletImage: string | null;\n // TODO: These are here just to test the functionality, the API should be more robust and account for tablet images.\n tabletBackgroundColor: string | null;\n dark?: {\n image?: string | null;\n backgroundColor?: string | null;\n tabletImage?: string | null;\n tabletBackgroundColor?: string | null;\n };\n}\n\n// TODO: Maybe use an array on splash with theme value. Then remove the array in serialization for legacy and manifest.\nexport function getIosSplashConfig(config: ExpoConfig): IOSSplashConfig | 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 iOS.\n if (config.ios?.splash) {\n const splash = config.ios?.splash;\n const image = splash.image ?? null;\n return {\n image,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n backgroundColor: splash.backgroundColor ?? defaultBackgroundColor,\n tabletImage: splash.tabletImage ?? null,\n tabletBackgroundColor: splash.tabletBackgroundColor,\n dark: {\n image: splash.dark?.image ?? null,\n backgroundColor: splash.dark?.backgroundColor,\n tabletImage: splash.dark?.tabletImage ?? null,\n tabletBackgroundColor: splash.dark?.tabletBackgroundColor,\n },\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n const image = splash.image ?? null;\n return {\n image,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n backgroundColor: splash.backgroundColor ?? defaultBackgroundColor,\n tabletImage: null,\n tabletBackgroundColor: null,\n dark: {\n image: null,\n backgroundColor: null,\n tabletImage: null,\n tabletBackgroundColor: null,\n },\n };\n }\n\n return {\n backgroundColor: '#ffffff',\n resizeMode: 'contain',\n tabletImage: null,\n tabletBackgroundColor: null,\n };\n}\n\nexport function warnUnsupportedSplashProperties(config: ExpoConfig) {\n if (config.ios?.splash?.xib) {\n WarningAggregator.addWarningIOS(\n 'ios.splash.xib',\n 'property is not supported in prebuild. Please use ios.splash.image instead.'\n );\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA,MAAMA,iBAAiB,GAAG,SAA1B;AACA,MAAMC,sBAAsB,GAAG,SAA/B;;AAkBA;AACO,SAASC,kBAAT,CAA4BC,MAA5B,EAAwE;EAAA;;EAC7E;EACA;EACA,mBAAIA,MAAM,CAACC,GAAX,wCAAI,YAAYC,MAAhB,EAAwB;IAAA;;IACtB,MAAMA,MAAM,mBAAGF,MAAM,CAACC,GAAV,iDAAG,aAAYC,MAA3B;IACA,MAAMC,KAAK,oBAAGD,MAAM,CAACC,KAAV,yDAAmB,IAA9B;IACA,OAAO;MACLA,KADK;MAELC,UAAU,wBAAEF,MAAM,CAACE,UAAT,mEAAuBP,iBAF5B;MAGLQ,eAAe,2BAAEH,MAAM,CAACG,eAAT,yEAA4BP,sBAHtC;MAILQ,WAAW,yBAAEJ,MAAM,CAACI,WAAT,qEAAwB,IAJ9B;MAKLC,qBAAqB,EAAEL,MAAM,CAACK,qBALzB;MAMLC,IAAI,EAAE;QACJL,KAAK,wCAAED,MAAM,CAACM,IAAT,iDAAE,aAAaL,KAAf,mEAAwB,IADzB;QAEJE,eAAe,mBAAEH,MAAM,CAACM,IAAT,kDAAE,cAAaH,eAF1B;QAGJC,WAAW,4CAAEJ,MAAM,CAACM,IAAT,kDAAE,cAAaF,WAAf,yEAA8B,IAHrC;QAIJC,qBAAqB,mBAAEL,MAAM,CAACM,IAAT,kDAAE,cAAaD;MAJhC;IAND,CAAP;EAaD;;EAED,IAAIP,MAAM,CAACE,MAAX,EAAmB;IAAA;;IACjB,MAAMA,MAAM,GAAGF,MAAM,CAACE,MAAtB;IACA,MAAMC,KAAK,qBAAGD,MAAM,CAACC,KAAV,2DAAmB,IAA9B;IACA,OAAO;MACLA,KADK;MAELC,UAAU,yBAAEF,MAAM,CAACE,UAAT,qEAAuBP,iBAF5B;MAGLQ,eAAe,4BAAEH,MAAM,CAACG,eAAT,2EAA4BP,sBAHtC;MAILQ,WAAW,EAAE,IAJR;MAKLC,qBAAqB,EAAE,IALlB;MAMLC,IAAI,EAAE;QACJL,KAAK,EAAE,IADH;QAEJE,eAAe,EAAE,IAFb;QAGJC,WAAW,EAAE,IAHT;QAIJC,qBAAqB,EAAE;MAJnB;IAND,CAAP;EAaD;;EAED,OAAO;IACLF,eAAe,EAAE,SADZ;IAELD,UAAU,EAAE,SAFP;IAGLE,WAAW,EAAE,IAHR;IAILC,qBAAqB,EAAE;EAJlB,CAAP;AAMD;;AAEM,SAASE,+BAAT,CAAyCT,MAAzC,EAA6D;EAAA;;EAClE,oBAAIA,MAAM,CAACC,GAAX,gEAAI,aAAYC,MAAhB,gDAAI,oBAAoBQ,GAAxB,EAA6B;IAC3BC,kCAAA,CAAkBC,aAAlB,CACE,gBADF,EAEE,6EAFF;EAID;AACF"}
1
+ {"version":3,"file":"getIosSplashConfig.js","names":["defaultResizeMode","defaultBackgroundColor","getIosSplashConfig","config","ios","splash","image","resizeMode","backgroundColor","tabletImage","tabletBackgroundColor","dark"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/getIosSplashConfig.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\ntype ExpoConfigIosSplash = NonNullable<NonNullable<ExpoConfig['ios']>['splash']>;\n\nconst defaultResizeMode = 'contain';\nconst defaultBackgroundColor = '#ffffff';\n\nexport interface IOSSplashConfig {\n image?: string | null;\n // tabletImage: string | null;\n backgroundColor: string;\n resizeMode: NonNullable<ExpoConfigIosSplash['resizeMode']>;\n tabletImage: string | null;\n // TODO: These are here just to test the functionality, the API should be more robust and account for tablet images.\n tabletBackgroundColor: string | null;\n dark?: {\n image?: string | null;\n backgroundColor?: string | null;\n tabletImage?: string | null;\n tabletBackgroundColor?: string | null;\n };\n}\n\n// TODO: Maybe use an array on splash with theme value. Then remove the array in serialization for legacy and manifest.\nexport function getIosSplashConfig(config: ExpoConfig): IOSSplashConfig | 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 iOS.\n if (config.ios?.splash) {\n const splash = config.ios?.splash;\n const image = splash.image ?? null;\n return {\n image,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n backgroundColor: splash.backgroundColor ?? defaultBackgroundColor,\n tabletImage: splash.tabletImage ?? null,\n tabletBackgroundColor: splash.tabletBackgroundColor,\n dark: {\n image: splash.dark?.image ?? null,\n backgroundColor: splash.dark?.backgroundColor,\n tabletImage: splash.dark?.tabletImage ?? null,\n tabletBackgroundColor: splash.dark?.tabletBackgroundColor,\n },\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n const image = splash.image ?? null;\n return {\n image,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n backgroundColor: splash.backgroundColor ?? defaultBackgroundColor,\n tabletImage: null,\n tabletBackgroundColor: null,\n dark: {\n image: null,\n backgroundColor: null,\n tabletImage: null,\n tabletBackgroundColor: null,\n },\n };\n }\n\n return {\n backgroundColor: '#ffffff',\n resizeMode: 'contain',\n tabletImage: null,\n tabletBackgroundColor: null,\n };\n}\n"],"mappings":";;;;;;AAIA,MAAMA,iBAAiB,GAAG,SAAS;AACnC,MAAMC,sBAAsB,GAAG,SAAS;AAkBxC;AACO,SAASC,kBAAkB,CAACC,MAAkB,EAA0B;EAAA;EAC7E;EACA;EACA,mBAAIA,MAAM,CAACC,GAAG,wCAAV,YAAYC,MAAM,EAAE;IAAA;IACtB,MAAMA,MAAM,mBAAGF,MAAM,CAACC,GAAG,iDAAV,aAAYC,MAAM;IACjC,MAAMC,K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{
5
5
  });
6
6
  exports.setSplashDrawableAsync = setSplashDrawableAsync;
7
7
  exports.withAndroidSplashDrawables = void 0;
8
-
9
8
  function _configPlugins() {
10
9
  const data = require("@expo/config-plugins");
11
-
12
10
  _configPlugins = function () {
13
11
  return data;
14
12
  };
15
-
16
13
  return data;
17
14
  }
18
-
19
15
  const withAndroidSplashDrawables = (config, splash) => {
20
16
  return (0, _configPlugins().withDangerousMod)(config, ['android', async config => {
21
17
  if (splash) {
22
18
  await setSplashDrawableAsync(splash, config.modRequest.projectRoot);
23
19
  }
24
-
25
20
  return config;
26
21
  }]);
27
22
  };
28
-
29
23
  exports.withAndroidSplashDrawables = withAndroidSplashDrawables;
30
-
31
24
  async function setSplashDrawableAsync({
32
25
  resizeMode
33
26
  }, projectRoot) {
34
27
  const filePath = await _configPlugins().AndroidConfig.Paths.getResourceXMLPathAsync(projectRoot, {
35
28
  name: 'splashscreen',
36
29
  kind: 'drawable'
37
- }); // Nuke and rewrite the splashscreen.xml drawable
30
+ });
38
31
 
32
+ // Nuke and rewrite the splashscreen.xml drawable
39
33
  const xmlContent = {
40
34
  'layer-list': {
41
35
  $: {
@@ -46,7 +40,8 @@ async function setSplashDrawableAsync({
46
40
  // TODO: Ensure these keys don't get out of sync
47
41
  'android:drawable': '@color/splashscreen_background'
48
42
  }
49
- }, // Only include the image if resizeMode native is in-use.
43
+ },
44
+ // Only include the image if resizeMode native is in-use.
50
45
  resizeMode === 'native' && {
51
46
  bitmap: [{
52
47
  $: {
@@ -1 +1 @@
1
- {"version":3,"file":"withAndroidSplashDrawables.js","names":["withAndroidSplashDrawables","config","splash","withDangerousMod","setSplashDrawableAsync","modRequest","projectRoot","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: 'splashscreen',\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 resizeMode === 'native' && {\n bitmap: [\n {\n $: {\n 'android:gravity': 'center',\n // TODO: Ensure these keys don't get out of sync\n 'android:src': '@drawable/splashscreen_image',\n },\n },\n ],\n },\n ].filter(Boolean),\n },\n };\n await XML.writeXMLAsync({ path: filePath, xml: xmlContent });\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIO,MAAMA,0BAAgF,GAAG,CAC9FC,MAD8F,EAE9FC,MAF8F,KAG3F;EACH,OAAO,IAAAC,iCAAA,EAAiBF,MAAjB,EAAyB,CAC9B,SAD8B,EAE9B,MAAOA,MAAP,IAAkB;IAChB,IAAIC,MAAJ,EAAY;MACV,MAAME,sBAAsB,CAACF,MAAD,EAASD,MAAM,CAACI,UAAP,CAAkBC,WAA3B,CAA5B;IACD;;IACD,OAAOL,MAAP;EACD,CAP6B,CAAzB,CAAP;AASD,CAbM;;;;AAeA,eAAeG,sBAAf,CACL;EAAEG;AAAF,CADK,EAELD,WAFK,EAGL;EACA,MAAME,QAAQ,GAAI,MAAMC,8BAAA,CAAcC,KAAd,CAAoBC,uBAApB,CAA4CL,WAA5C,EAAyD;IAC/EM,IAAI,EAAE,cADyE;IAE/EC,IAAI,EAAE;EAFyE,CAAzD,CAAxB,CADA,CAMA;;EACA,MAAMC,UAAU,GAAG;IACjB,cAAc;MACZC,CAAC,EAAE;QACD,iBAAiB;MADhB,CADS;MAIZC,IAAI,EAAE,CACJ;QACED,CAAC,EAAE;UACD;UACA,oBAAoB;QAFnB;MADL,CADI,EAOJ;MACAR,UAAU,KAAK,QAAf,IAA2B;QACzBU,MAAM,EAAE,CACN;UACEF,CAAC,EAAE;YACD,mBAAmB,QADlB;YAED;YACA,eAAe;UAHd;QADL,CADM;MADiB,CARvB,EAmBJG,MAnBI,CAmBGC,OAnBH;IAJM;EADG,CAAnB;EA2BA,MAAMC,oBAAA,CAAIC,aAAJ,CAAkB;IAAEC,IAAI,EAAEd,QAAR;IAAkBe,GAAG,EAAET;EAAvB,CAAlB,CAAN;AACD"}
1
+ {"version":3,"file":"withAndroidSplashDrawables.js","names":["withAndroidSplashDrawables","config","splash","withDangerousMod","setSplashDrawableAsync","modRequest","projectRoot","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: 'splashscreen',\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 resizeMode === 'native' && {\n bitmap: [\n {\n $: {\n 'android:gravity': 'center',\n // TODO: Ensure these keys don't get out of sync\n 'android:src': '@drawable/splashscreen_image',\n },\n },\n ],\n },\n ].filter(Boolean),\n },\n };\n await XML.writeXMLAsync({ path: filePath, xml: xmlContent });\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIO,MAAMA,0BAAgF,GAAG,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;AAAC;AAEK,eAAeG,sBAAsB,CAC1C;EAAEG;AAAmD,CAAC,EACtDD,WAAmB,EACnB;EACA,MAAME,QAAQ,GAAI,MAAMC,8BAAa,CAACC,KAAK,CAACC,uBAAuB,CAACL,WAAW,EAAE;IAC/EM,IAAI,EAAE,cAAc;IACpBC,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;MACAR,UAAU,KAAK,QAAQ,IAAI;QACzBU,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"}
@@ -6,59 +6,42 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.setSplashImageDrawablesAsync = setSplashImageDrawablesAsync;
7
7
  exports.setSplashImageDrawablesForThemeAsync = setSplashImageDrawablesForThemeAsync;
8
8
  exports.withAndroidSplashImages = void 0;
9
-
10
9
  function _configPlugins() {
11
10
  const data = require("@expo/config-plugins");
12
-
13
11
  _configPlugins = function () {
14
12
  return data;
15
13
  };
16
-
17
14
  return data;
18
15
  }
19
-
20
16
  function _imageUtils() {
21
17
  const data = require("@expo/image-utils");
22
-
23
18
  _imageUtils = function () {
24
19
  return data;
25
20
  };
26
-
27
21
  return data;
28
22
  }
29
-
30
23
  function _fsExtra() {
31
24
  const data = _interopRequireDefault(require("fs-extra"));
32
-
33
25
  _fsExtra = function () {
34
26
  return data;
35
27
  };
36
-
37
28
  return data;
38
29
  }
39
-
40
30
  function _path() {
41
31
  const data = _interopRequireDefault(require("path"));
42
-
43
32
  _path = function () {
44
33
  return data;
45
34
  };
46
-
47
35
  return data;
48
36
  }
49
-
50
37
  function _getAndroidSplashConfig() {
51
38
  const data = require("./getAndroidSplashConfig");
52
-
53
39
  _getAndroidSplashConfig = function () {
54
40
  return data;
55
41
  };
56
-
57
42
  return data;
58
43
  }
59
-
60
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61
-
62
45
  const IMAGE_CACHE_NAME = 'splash-android';
63
46
  const SPLASH_SCREEN_FILENAME = 'splashscreen_image.png';
64
47
  const DRAWABLES_CONFIGS = {
@@ -129,13 +112,13 @@ const DRAWABLES_CONFIGS = {
129
112
  dimensionsMultiplier: 4
130
113
  }
131
114
  };
132
-
133
115
  const withAndroidSplashImages = config => {
134
116
  return (0, _configPlugins().withDangerousMod)(config, ['android', async config => {
135
117
  await setSplashImageDrawablesAsync(config, config.modRequest.projectRoot);
136
118
  return config;
137
119
  }]);
138
120
  };
121
+
139
122
  /**
140
123
  * Deletes all previous splash_screen_images and copies new one to desired drawable directory.
141
124
  * If path isn't provided then no new image is placed in drawable directories.
@@ -143,20 +126,15 @@ const withAndroidSplashImages = config => {
143
126
  *
144
127
  * @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.
145
128
  */
146
-
147
-
148
129
  exports.withAndroidSplashImages = withAndroidSplashImages;
149
-
150
130
  async function setSplashImageDrawablesAsync(config, projectRoot) {
151
131
  await clearAllExistingSplashImagesAsync(projectRoot);
152
132
  const splash = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
153
133
  const darkSplash = (0, _getAndroidSplashConfig().getAndroidDarkSplashConfig)(config);
154
134
  await Promise.all([setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot), setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot)]);
155
135
  }
156
-
157
136
  async function clearAllExistingSplashImagesAsync(projectRoot) {
158
137
  const androidMainPath = _path().default.join(projectRoot, 'android/app/src/main');
159
-
160
138
  await Promise.all(Object.values(DRAWABLES_CONFIGS).map(async ({
161
139
  modes
162
140
  }) => {
@@ -169,16 +147,12 @@ async function clearAllExistingSplashImagesAsync(projectRoot) {
169
147
  }));
170
148
  }));
171
149
  }
172
-
173
150
  async function setSplashImageDrawablesForThemeAsync(config, theme, projectRoot) {
174
151
  if (!config) return;
175
-
176
152
  const androidMainPath = _path().default.join(projectRoot, 'android/app/src/main');
177
-
178
153
  await Promise.all(['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'].map(async imageKey => {
179
154
  // @ts-ignore
180
155
  const image = config[imageKey];
181
-
182
156
  if (image) {
183
157
  // Using this method will cache the images in `.expo` based on the properties used to generate them.
184
158
  // this method also supports remote URLs and using the global sharp instance.
@@ -189,19 +163,18 @@ async function setSplashImageDrawablesForThemeAsync(config, theme, projectRoot)
189
163
  cacheType: IMAGE_CACHE_NAME
190
164
  }, {
191
165
  src: image
192
- }); // Get output path for drawable.
193
-
194
- const outputPath = _path().default.join(androidMainPath, // @ts-ignore
195
- DRAWABLES_CONFIGS[imageKey].modes[theme].path); // Ensure directory exists.
196
-
166
+ });
197
167
 
168
+ // Get output path for drawable.
169
+ const outputPath = _path().default.join(androidMainPath,
170
+ // @ts-ignore
171
+ DRAWABLES_CONFIGS[imageKey].modes[theme].path);
172
+ // Ensure directory exists.
198
173
  const folder = _path().default.dirname(outputPath);
199
-
200
- await _fsExtra().default.ensureDir(folder); // Write image buffer to the file system.
201
-
174
+ await _fsExtra().default.ensureDir(folder);
175
+ // Write image buffer to the file system.
202
176
  await _fsExtra().default.writeFile(outputPath, source);
203
177
  }
204
-
205
178
  return null;
206
179
  }));
207
180
  }
@@ -1 +1 @@
1
- {"version":3,"file":"withAndroidSplashImages.js","names":["IMAGE_CACHE_NAME","SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","default","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","withDangerousMod","setSplashImageDrawablesAsync","modRequest","projectRoot","clearAllExistingSplashImagesAsync","splash","getAndroidSplashConfig","darkSplash","getAndroidDarkSplashConfig","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","imageKey","image","source","generateImageAsync","cacheType","src","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 { generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\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_image.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 = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setSplashImageDrawablesAsync(config, config.modRequest.projectRoot);\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 projectRoot: string\n) {\n await clearAllExistingSplashImagesAsync(projectRoot);\n\n const splash = getAndroidSplashConfig(config);\n const darkSplash = getAndroidDarkSplashConfig(config);\n\n await Promise.all([\n setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot),\n setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot),\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) {\n if (!config) return;\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'].map(async (imageKey) => {\n // @ts-ignore\n const image = config[imageKey];\n if (image) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: image,\n } as any);\n\n // Get output path for drawable.\n const outputPath = path.join(\n androidMainPath,\n // @ts-ignore\n DRAWABLES_CONFIGS[imageKey].modes[theme].path\n );\n // Ensure directory exists.\n const folder = path.dirname(outputPath);\n await fs.ensureDir(folder);\n // Write image buffer to the file system.\n await fs.writeFile(outputPath, source);\n }\n return null;\n })\n );\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AASA,MAAMA,gBAAgB,GAAG,gBAAzB;AACA,MAAMC,sBAAsB,GAAG,wBAA/B;AACA,MAAMC,iBASL,GAAG;EACFC,OAAO,EAAE;IACPC,KAAK,EAAE;MACLC,KAAK,EAAE;QACLC,IAAI,EAAG,kBAAiBL,sBAAuB;MAD1C,CADF;MAILM,IAAI,EAAE;QACJD,IAAI,EAAG,wBAAuBL,sBAAuB;MADjD;IAJD,CADA;IASPO,oBAAoB,EAAE;EATf,CADP;EAYFC,IAAI,EAAE;IACJL,KAAK,EAAE;MACLC,KAAK,EAAE;QACLC,IAAI,EAAG,uBAAsBL,sBAAuB;MAD/C,CADF;MAILM,IAAI,EAAE;QACJD,IAAI,EAAG,6BAA4BL,sBAAuB;MADtD;IAJD,CADH;IASJO,oBAAoB,EAAE;EATlB,CAZJ;EAuBFE,IAAI,EAAE;IACJN,KAAK,EAAE;MACLC,KAAK,EAAE;QACLC,IAAI,EAAG,uBAAsBL,sB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E;IACA,MAAMC,KAAK,GAAGzB,MAAM,CAACwB,QAAD,CAApB;;IACA,IAAIC,KAAJ,EAAW;MACT;MACA;MACA,MAAM;QAAEC;MAAF,IAAa,MAAM,IAAAC,gCAAA,EAAmB;QAAEvB,WAAF;QAAewB,SAAS,EAAE3C;MAA1B,CAAnB,EAAiE;QACxF4C,GAAG,EAAEJ;MADmF,CAAjE,CAAzB,CAHS,CAOT;;MACA,MAAMK,UAAU,GAAGvC,eAAA,CAAKuB,IAAL,CACjBD,eADiB,EAEjB;MACA1B,iBAAiB,CAACqC,QAAD,CAAjB,CAA4BnC,KAA5B,CAAkCkC,KAAlC,EAAyChC,IAHxB,CAAnB,CARS,CAaT;;;MACA,MAAMwC,MAAM,GAAGxC,eAAA,CAAKyC,OAAL,CAAaF,UAAb,CAAf;;MACA,MAAMX,kBAAA,CAAGc,SAAH,CAAaF,MAAb,CAAN,CAfS,CAgBT;;MACA,MAAMZ,kBAAA,CAAGe,SAAH,CAAaJ,UAAb,EAAyBJ,MAAzB,CAAN;IACD;;IACD,OAAO,IAAP;EACD,CAvBD,CADI,CAAN;AA0BD"}
1
+ {"version":3,"file":"withAndroidSplashImages.js","names":["IMAGE_CACHE_NAME","SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","default","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","withDangerousMod","setSplashImageDrawablesAsync","modRequest","projectRoot","clearAllExistingSplashImagesAsync","splash","getAndroidSplashConfig","darkSplash","getAndroidDarkSplashConfig","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","imageKey","image","source","generateImageAsync","cacheType","src","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 { generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\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_image.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 = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setSplashImageDrawablesAsync(config, config.modRequest.projectRoot);\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 projectRoot: string\n) {\n await clearAllExistingSplashImagesAsync(projectRoot);\n\n const splash = getAndroidSplashConfig(config);\n const darkSplash = getAndroidDarkSplashConfig(config);\n\n await Promise.all([\n setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot),\n setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot),\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) {\n if (!config) return;\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'].map(async (imageKey) => {\n // @ts-ignore\n const image = config[imageKey];\n if (image) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: image,\n } as any);\n\n // Get output path for drawable.\n const outputPath = path.join(\n androidMainPath,\n // @ts-ignore\n DRAWABLES_CONFIGS[imageKey].modes[theme].path\n );\n // Ensure directory exists.\n const folder = path.dirname(outputPath);\n await fs.ensureDir(folder);\n // Write image buffer to the file system.\n await fs.writeFile(outputPath, source);\n }\n return null;\n })\n );\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIkC;AAKlC,MAAMA,gBAAgB,GAAG,gBAAgB;AACzC,MAAMC,sBAAsB,GAAG,wBAAwB;AACvD,MAAMC,iBASL,GAAG;EACFC,OAAO,EAAE;IACPC,KAAK,EAAE;MACLC,KAAK,EAAE;QACLC,IAAI,EAAG,kBAAiBL,sBAAuB;MACjD,CAAC;MACDM,IAAI,EAAE;QACJD,IAAI,EAAG,wBAAuBL,sBAAuB;MACvD;IACF,CAAC;IACDO,oBAAoB,EAAE;EACxB,CAAC;EACDC,IAAI,EAAE;IACJL,KAAK,EAAE;MACLC,KAAK,EAAE;QACLC,IAAI,EAAG,uBAAsBL,sBAAuB;MACtD,CAAC;MACDM,IAAI,EAAE;QACJD,IAAI,EAAG,6BAA4BL,sBAAuB;MAC5D;IACF,CAAC;IACDO,oBAAoB,EAAE;EACxB,CAAC;EACDE,IAAI,EAAE;IACJN,KAAK,EAAE;MACLC,KAAK,EAAE;QACLC,IAAI,EAAG,uBAAsBL,sBAAuB;MACtD,CAAC;MACDM,IAAI,EAAE;QACJD,IAAI,EAAG,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ACA;MACA,MAAM;QAAEC;MAAO,CAAC,GAAG,MAAM,IAAAC,gCAAkB,EAAC;QAAEvB,WAAW;QAAEwB,SAAS,EAAE3C;MAAiB,CAAC,EAAE;QACxF4C,GAAG,EAAEJ;MACP,CAAC,CAAQ;;MAET;MACA,MAAMK,UAAU,GAAGvC,eAAI,CAACuB,IAAI,CAC1BD,eAAe;MACf;MACA1B,iBAAiB,CAACqC,QAAQ,CAAC,CAACnC,KAAK,CAACkC,KAAK,CAAC,CAAChC,IAAI,CAC9C;MACD;MACA,MAAMwC,MAAM,GAAGxC,eAAI,CAACyC,OAAO,CAACF,UAAU,CAAC;MACvC,MAAMX,kBAAE,CAACc,SAAS,CAACF,MAAM,CAAC;MAC1B;MACA,MAAMZ,kBAAE,CAACe,SAAS,CAACJ,UAAU,EAAEJ,MAAM,CAAC;IACxC;IACA,OAAO,IAAI;EACb,CAAC,CAAC,CACH;AACH"}
@@ -5,78 +5,57 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.setSplashScreenLegacyMainActivity = setSplashScreenLegacyMainActivity;
7
7
  exports.withAndroidSplashLegacyMainActivity = void 0;
8
-
9
8
  function _configPlugins() {
10
9
  const data = require("@expo/config-plugins");
11
-
12
10
  _configPlugins = function () {
13
11
  return data;
14
12
  };
15
-
16
13
  return data;
17
14
  }
18
-
19
15
  function _codeMod() {
20
16
  const data = require("@expo/config-plugins/build/android/codeMod");
21
-
22
17
  _codeMod = function () {
23
18
  return data;
24
19
  };
25
-
26
20
  return data;
27
21
  }
28
-
29
22
  function _generateCode() {
30
23
  const data = require("@expo/config-plugins/build/utils/generateCode");
31
-
32
24
  _generateCode = function () {
33
25
  return data;
34
26
  };
35
-
36
27
  return data;
37
28
  }
38
-
39
29
  function _debug() {
40
30
  const data = _interopRequireDefault(require("debug"));
41
-
42
31
  _debug = function () {
43
32
  return data;
44
33
  };
45
-
46
34
  return data;
47
35
  }
48
-
49
36
  function _getAndroidSplashConfig() {
50
37
  const data = require("./getAndroidSplashConfig");
51
-
52
38
  _getAndroidSplashConfig = function () {
53
39
  return data;
54
40
  };
55
-
56
41
  return data;
57
42
  }
58
-
59
43
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
44
+ const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:android:mainActivity');
60
45
 
61
- const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:android:mainActivity'); // DO NOT CHANGE
62
-
46
+ // DO NOT CHANGE
63
47
  const SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';
64
-
65
48
  const withAndroidSplashLegacyMainActivity = config => {
66
49
  return (0, _configPlugins().withMainActivity)(config, config => {
67
50
  config.modResults.contents = setSplashScreenLegacyMainActivity(config, config.modResults.contents, config.modResults.language);
68
51
  return config;
69
52
  });
70
53
  };
71
-
72
54
  exports.withAndroidSplashLegacyMainActivity = withAndroidSplashLegacyMainActivity;
73
-
74
55
  function setSplashScreenLegacyMainActivity(config, mainActivity, language) {
75
56
  var _config$androidStatus;
76
-
77
57
  debug(`Modify with language: "${language}"`);
78
58
  const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
79
-
80
59
  if (!splashConfig) {
81
60
  // Remove our generated code safely...
82
61
  const mod = (0, _generateCode().removeContents)({
@@ -84,15 +63,12 @@ function setSplashScreenLegacyMainActivity(config, mainActivity, language) {
84
63
  tag: SHOW_SPLASH_ID
85
64
  });
86
65
  mainActivity = mod.contents;
87
-
88
66
  if (mod.didClear) {
89
67
  debug('Removed SplashScreen.show()');
90
68
  }
91
-
92
69
  return mainActivity;
93
- } // TODO: Translucent is weird
94
-
95
-
70
+ }
71
+ // TODO: Translucent is weird
96
72
  const statusBarTranslucent = !!((_config$androidStatus = config.androidStatusBar) !== null && _config$androidStatus !== void 0 && _config$androidStatus.translucent);
97
73
  const {
98
74
  resizeMode
@@ -100,7 +76,6 @@ function setSplashScreenLegacyMainActivity(config, mainActivity, language) {
100
76
  const isJava = language === 'java';
101
77
  const LE = isJava ? ';' : '';
102
78
  mainActivity = (0, _codeMod().addImports)(mainActivity, ['expo.modules.splashscreen.SplashScreen', 'expo.modules.splashscreen.SplashScreenImageResizeMode', 'android.os.Bundle'], isJava);
103
-
104
79
  if (!mainActivity.match(/(?<=^.*super\.onCreate.*$)/m)) {
105
80
  const onCreateBlock = isJava ? [' @Override', ' protected void onCreate(Bundle savedInstanceState) {', ' super.onCreate(savedInstanceState);', ' }'] : [' override fun onCreate(savedInstanceState: Bundle?) {', ' super.onCreate(savedInstanceState)', ' }'];
106
81
  mainActivity = (0, _generateCode().mergeContents)({
@@ -112,18 +87,20 @@ function setSplashScreenLegacyMainActivity(config, mainActivity, language) {
112
87
  tag: 'expo-splash-screen-mainActivity-onCreate',
113
88
  newSrc: onCreateBlock.join('\n')
114
89
  }).contents;
115
- } // Remove our generated code safely...
116
-
90
+ }
117
91
 
92
+ // Remove our generated code safely...
118
93
  mainActivity = (0, _generateCode().removeContents)({
119
94
  src: mainActivity,
120
95
  tag: SHOW_SPLASH_ID
121
- }).contents; // Remove code from `@expo/configure-splash-screen`
96
+ }).contents;
122
97
 
98
+ // Remove code from `@expo/configure-splash-screen`
123
99
  mainActivity = mainActivity.split('\n').filter(line => {
124
100
  return !/SplashScreen\.show\(this,\s?SplashScreenImageResizeMode\./.test(line);
125
- }).join('\n'); // Reapply generated code.
101
+ }).join('\n');
126
102
 
103
+ // Reapply generated code.
127
104
  mainActivity = (0, _generateCode().mergeContents)({
128
105
  src: mainActivity,
129
106
  // insert just below super.onCreate
@@ -132,7 +109,9 @@ function setSplashScreenLegacyMainActivity(config, mainActivity, language) {
132
109
  comment: '//',
133
110
  tag: SHOW_SPLASH_ID,
134
111
  newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${isJava ? '.class' : '::class.java'}, ${statusBarTranslucent})${LE}`
135
- }).contents; // TODO: Remove old `SplashScreen.show`
112
+ }).contents;
113
+
114
+ // TODO: Remove old `SplashScreen.show`
136
115
 
137
116
  return mainActivity;
138
117
  }