@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 +1 @@
1
- {"version":3,"file":"withAndroidSplashLegacyMainActivity.js","names":["debug","Debug","SHOW_SPLASH_ID","withAndroidSplashLegacyMainActivity","config","withMainActivity","modResults","contents","setSplashScreenLegacyMainActivity","language","mainActivity","splashConfig","getAndroidSplashConfig","mod","removeContents","src","tag","didClear","statusBarTranslucent","androidStatusBar","translucent","resizeMode","isJava","LE","addImports","match","onCreateBlock","mergeContents","anchor","offset","comment","newSrc","join","split","filter","line","test","toUpperCase"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.ts"],"sourcesContent":["import { ConfigPlugin, withMainActivity } from '@expo/config-plugins';\nimport { addImports } from '@expo/config-plugins/build/android/codeMod';\nimport { mergeContents, removeContents } from '@expo/config-plugins/build/utils/generateCode';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:android:mainActivity');\n\n// DO NOT CHANGE\nconst SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';\n\nexport const withAndroidSplashLegacyMainActivity: ConfigPlugin = (config) => {\n return withMainActivity(config, (config) => {\n config.modResults.contents = setSplashScreenLegacyMainActivity(\n config,\n config.modResults.contents,\n config.modResults.language\n );\n return config;\n });\n};\n\nexport function setSplashScreenLegacyMainActivity(\n config: Pick<ExpoConfig, 'android' | 'androidStatusBar' | 'userInterfaceStyle'>,\n mainActivity: string,\n language: 'java' | 'kt'\n): string {\n debug(`Modify with language: \"${language}\"`);\n const splashConfig = getAndroidSplashConfig(config);\n\n if (!splashConfig) {\n // Remove our generated code safely...\n const mod = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n });\n\n mainActivity = mod.contents;\n if (mod.didClear) {\n debug('Removed SplashScreen.show()');\n }\n return mainActivity;\n }\n // TODO: Translucent is weird\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n\n const { resizeMode } = splashConfig;\n const isJava = language === 'java';\n const LE = isJava ? ';' : '';\n\n mainActivity = addImports(\n mainActivity,\n [\n 'expo.modules.splashscreen.SplashScreen',\n 'expo.modules.splashscreen.SplashScreenImageResizeMode',\n 'android.os.Bundle',\n ],\n isJava\n );\n\n if (!mainActivity.match(/(?<=^.*super\\.onCreate.*$)/m)) {\n const onCreateBlock = isJava\n ? [\n ' @Override',\n ' protected void onCreate(Bundle savedInstanceState) {',\n ' super.onCreate(savedInstanceState);',\n ' }',\n ]\n : [\n ' override fun onCreate(savedInstanceState: Bundle?) {',\n ' super.onCreate(savedInstanceState)',\n ' }',\n ];\n\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: isJava\n ? /(?<=public\\s+class\\s+.*\\s+extends\\s+.*\\s+{.*$)/m\n : /(?<=class\\s+.*\\s+:\\s+.*\\s+{.*$)/m,\n offset: 1,\n comment: '//',\n tag: 'expo-splash-screen-mainActivity-onCreate',\n newSrc: onCreateBlock.join('\\n'),\n }).contents;\n }\n\n // Remove our generated code safely...\n mainActivity = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n }).contents;\n\n // Remove code from `@expo/configure-splash-screen`\n mainActivity = mainActivity\n .split('\\n')\n .filter((line) => {\n return !/SplashScreen\\.show\\(this,\\s?SplashScreenImageResizeMode\\./.test(line);\n })\n .join('\\n');\n\n // Reapply generated code.\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: /(?<=^.*super\\.onCreate.*$)/m,\n offset: 1,\n comment: '//',\n tag: SHOW_SPLASH_ID,\n newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${\n isJava ? '.class' : '::class.java'\n }, ${statusBarTranslucent})${LE}`,\n }).contents;\n\n // TODO: Remove old `SplashScreen.show`\n\n return mainActivity;\n}\n"],"mappings":";;;;;;;;AAAA;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;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEA,MAAMA,KAAK,GAAG,IAAAC,gBAAA,EAAM,8DAAN,CAAd,C,CAEA;;AACA,MAAMC,cAAc,GAAG,sDAAvB;;AAEO,MAAMC,mCAAiD,GAAIC,MAAD,IAAY;EAC3E,OAAO,IAAAC,iCAAA,EAAiBD,MAAjB,EAA0BA,MAAD,IAAY;IAC1CA,MAAM,CAACE,UAAP,CAAkBC,QAAlB,GAA6BC,iCAAiC,CAC5DJ,MAD4D,EAE5DA,MAAM,CAACE,UAAP,CAAkBC,QAF0C,EAG5DH,MAAM,CAACE,UAAP,CAAkBG,QAH0C,CAA9D;IAKA,OAAOL,MAAP;EACD,CAPM,CAAP;AAQD,CATM;;;;AAWA,SAASI,iCAAT,CACLJ,MADK,EAELM,YAFK,EAGLD,QAHK,EAIG;EAAA;;EACRT,KAAK,CAAE,0BAAyBS,QA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AVH;EAWD,CA3DO,CA6DR;;;EACAG,YAAY,GAAG,IAAAI,8BAAA,EAAe;IAC5BC,GAAG,EAAEL,YADuB;IAE5BM,GAAG,EAAEd;EAFuB,CAAf,EAGZK,QAHH,CA9DQ,CAmER;;EACAG,YAAY,GAAGA,YAAY,CACxBuB,KADY,CACN,IADM,EAEZC,MAFY,CAEJC,IAAD,IAAU;IAChB,OAAO,CAAC,4DAA4DC,IAA5D,CAAiED,IAAjE,CAAR;EACD,CAJY,EAKZH,IALY,CAKP,IALO,CAAf,CApEQ,CA2ER;;EACAtB,YAAY,GAAG,IAAAiB,6BAAA,EAAc;IAC3BZ,GAAG,EAAEL,YADsB;IAE3B;IACAkB,MAAM,EAAE,6BAHmB;IAI3BC,MAAM,EAAE,CAJmB;IAK3BC,OAAO,EAAE,IALkB;IAM3Bd,GAAG,EAAEd,cANsB;IAO3B6B,MAAM,EAAG,2DAA0DV,UAAU,CAACgB,WAAX,EAAyB,kBAC1Ff,MAAM,GAAG,QAAH,GAAc,cACrB,KAAIJ,oBAAqB,IAAGK,EAAG;EATL,CAAd,EAUZhB,QAVH,CA5EQ,CAwFR;;EAEA,OAAOG,YAAP;AACD"}
1
+ {"version":3,"file":"withAndroidSplashLegacyMainActivity.js","names":["debug","Debug","SHOW_SPLASH_ID","withAndroidSplashLegacyMainActivity","config","withMainActivity","modResults","contents","setSplashScreenLegacyMainActivity","language","mainActivity","splashConfig","getAndroidSplashConfig","mod","removeContents","src","tag","didClear","statusBarTranslucent","androidStatusBar","translucent","resizeMode","isJava","LE","addImports","match","onCreateBlock","mergeContents","anchor","offset","comment","newSrc","join","split","filter","line","test","toUpperCase"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.ts"],"sourcesContent":["import { ConfigPlugin, withMainActivity } from '@expo/config-plugins';\nimport { addImports } from '@expo/config-plugins/build/android/codeMod';\nimport { mergeContents, removeContents } from '@expo/config-plugins/build/utils/generateCode';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:android:mainActivity');\n\n// DO NOT CHANGE\nconst SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';\n\nexport const withAndroidSplashLegacyMainActivity: ConfigPlugin = (config) => {\n return withMainActivity(config, (config) => {\n config.modResults.contents = setSplashScreenLegacyMainActivity(\n config,\n config.modResults.contents,\n config.modResults.language\n );\n return config;\n });\n};\n\nexport function setSplashScreenLegacyMainActivity(\n config: Pick<ExpoConfig, 'android' | 'androidStatusBar' | 'userInterfaceStyle'>,\n mainActivity: string,\n language: 'java' | 'kt'\n): string {\n debug(`Modify with language: \"${language}\"`);\n const splashConfig = getAndroidSplashConfig(config);\n\n if (!splashConfig) {\n // Remove our generated code safely...\n const mod = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n });\n\n mainActivity = mod.contents;\n if (mod.didClear) {\n debug('Removed SplashScreen.show()');\n }\n return mainActivity;\n }\n // TODO: Translucent is weird\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n\n const { resizeMode } = splashConfig;\n const isJava = language === 'java';\n const LE = isJava ? ';' : '';\n\n mainActivity = addImports(\n mainActivity,\n [\n 'expo.modules.splashscreen.SplashScreen',\n 'expo.modules.splashscreen.SplashScreenImageResizeMode',\n 'android.os.Bundle',\n ],\n isJava\n );\n\n if (!mainActivity.match(/(?<=^.*super\\.onCreate.*$)/m)) {\n const onCreateBlock = isJava\n ? [\n ' @Override',\n ' protected void onCreate(Bundle savedInstanceState) {',\n ' super.onCreate(savedInstanceState);',\n ' }',\n ]\n : [\n ' override fun onCreate(savedInstanceState: Bundle?) {',\n ' super.onCreate(savedInstanceState)',\n ' }',\n ];\n\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: isJava\n ? /(?<=public\\s+class\\s+.*\\s+extends\\s+.*\\s+{.*$)/m\n : /(?<=class\\s+.*\\s+:\\s+.*\\s+{.*$)/m,\n offset: 1,\n comment: '//',\n tag: 'expo-splash-screen-mainActivity-onCreate',\n newSrc: onCreateBlock.join('\\n'),\n }).contents;\n }\n\n // Remove our generated code safely...\n mainActivity = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n }).contents;\n\n // Remove code from `@expo/configure-splash-screen`\n mainActivity = mainActivity\n .split('\\n')\n .filter((line) => {\n return !/SplashScreen\\.show\\(this,\\s?SplashScreenImageResizeMode\\./.test(line);\n })\n .join('\\n');\n\n // Reapply generated code.\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: /(?<=^.*super\\.onCreate.*$)/m,\n offset: 1,\n comment: '//',\n tag: SHOW_SPLASH_ID,\n newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${\n isJava ? '.class' : '::class.java'\n }, ${statusBarTranslucent})${LE}`,\n }).contents;\n\n // TODO: Remove old `SplashScreen.show`\n\n return mainActivity;\n}\n"],"mappings":";;;;;;;AAAA;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;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAkE;AAElE,MAAMA,KAAK,GAAG,IAAAC,gBAAK,EAAC,8DAA8D,CAAC;;AAEnF;AACA,MAAMC,cAAc,GAAG,sDAAsD;AAEtE,MAAMC,mCAAiD,GAAIC,MAAM,IAAK;EAC3E,OAAO,IAAAC,iCAAgB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC1CA,MAAM,CAACE,UAAU,CAACC,QAAQ,GAAGC,iCAAiC,CAC5DJ,MAAM,EACNA,MAAM,CAACE,UAAU,CAACC,QAAQ,EAC1BH,MAAM,CAACE,UAAU,CAACG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,kCAAkC;MACtCO,MAAM,EAAE,CAAC;MACTC,OAAO,EAAE,IAAI;MACbd,GAAG,EAAE,0CAA0C;MAC/Ce,MAAM,EAAEL,aAAa,CAACM,IAAI,CAAC,IAAI;IACjC,CAAC,CAAC,CAACzB,QAAQ;EACb;;EAEA;EACAG,YAAY,GAAG,IAAAI,8BAAc,EAAC;IAC5BC,GAAG,EAAEL,YAAY;IACjBM,GAAG,EAAEd;EACP,CAAC,CAAC,CAACK,QAAQ;;EAEX;EACAG,YAAY,GAAGA,YAAY,CACxBuB,KAAK,CAAC,IAAI,CAAC,CACXC,MAAM,CAAEC,IAAI,IAAK;IAChB,OAAO,CAAC,2DAA2D,CAACC,IAAI,CAACD,IAAI,CAAC;EAChF,CAAC,CAAC,CACDH,IAAI,CAAC,IAAI,CAAC;;EAEb;EACAtB,YAAY,GAAG,IAAAiB,6BAAa,EAAC;IAC3BZ,GAAG,EAAEL,YAAY;IACjB;IACAkB,MAAM,EAAE,6BAA6B;IACrCC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE,IAAI;IACbd,GAAG,EAAEd,cAAc;IACnB6B,MAAM,EAAG,2DAA0DV,UAAU,CAACgB,WAAW,EAAG,kBAC1Ff,MAAM,GAAG,QAAQ,GAAG,cACrB,KAAIJ,oBAAqB,IAAGK,EAAG;EAClC,CAAC,CAAC,CAAChB,QAAQ;;EAEX;;EAEA,OAAOG,YAAY;AACrB"}
@@ -4,120 +4,86 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.withAndroidSplashScreen = void 0;
7
-
8
7
  function _configPlugins() {
9
8
  const data = require("@expo/config-plugins");
10
-
11
9
  _configPlugins = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _jsonFile() {
19
15
  const data = _interopRequireDefault(require("@expo/json-file"));
20
-
21
16
  _jsonFile = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  function _resolveFrom() {
29
22
  const data = _interopRequireDefault(require("resolve-from"));
30
-
31
23
  _resolveFrom = function () {
32
24
  return data;
33
25
  };
34
-
35
26
  return data;
36
27
  }
37
-
38
28
  function _semver() {
39
29
  const data = _interopRequireDefault(require("semver"));
40
-
41
30
  _semver = function () {
42
31
  return data;
43
32
  };
44
-
45
33
  return data;
46
34
  }
47
-
48
35
  function _getAndroidSplashConfig() {
49
36
  const data = require("./getAndroidSplashConfig");
50
-
51
37
  _getAndroidSplashConfig = function () {
52
38
  return data;
53
39
  };
54
-
55
40
  return data;
56
41
  }
57
-
58
42
  function _withAndroidSplashDrawables() {
59
43
  const data = require("./withAndroidSplashDrawables");
60
-
61
44
  _withAndroidSplashDrawables = function () {
62
45
  return data;
63
46
  };
64
-
65
47
  return data;
66
48
  }
67
-
68
49
  function _withAndroidSplashImages() {
69
50
  const data = require("./withAndroidSplashImages");
70
-
71
51
  _withAndroidSplashImages = function () {
72
52
  return data;
73
53
  };
74
-
75
54
  return data;
76
55
  }
77
-
78
56
  function _withAndroidSplashLegacyMainActivity() {
79
57
  const data = require("./withAndroidSplashLegacyMainActivity");
80
-
81
58
  _withAndroidSplashLegacyMainActivity = function () {
82
59
  return data;
83
60
  };
84
-
85
61
  return data;
86
62
  }
87
-
88
63
  function _withAndroidSplashStrings() {
89
64
  const data = require("./withAndroidSplashStrings");
90
-
91
65
  _withAndroidSplashStrings = function () {
92
66
  return data;
93
67
  };
94
-
95
68
  return data;
96
69
  }
97
-
98
70
  function _withAndroidSplashStyles() {
99
71
  const data = require("./withAndroidSplashStyles");
100
-
101
72
  _withAndroidSplashStyles = function () {
102
73
  return data;
103
74
  };
104
-
105
75
  return data;
106
76
  }
107
-
108
77
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
109
-
110
78
  const withAndroidSplashScreen = config => {
111
79
  var _config$androidStatus;
80
+ const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
112
81
 
113
- const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config); // Update the android status bar to match the splash screen
82
+ // Update the android status bar to match the splash screen
114
83
  // androidStatusBar applies info to the app activity style.
115
-
116
84
  const backgroundColor = (splashConfig === null || splashConfig === void 0 ? void 0 : splashConfig.backgroundColor) || '#ffffff';
117
-
118
85
  if ((_config$androidStatus = config.androidStatusBar) !== null && _config$androidStatus !== void 0 && _config$androidStatus.backgroundColor) {
119
86
  var _config$androidStatus2, _config$androidStatus3, _config$androidStatus4;
120
-
121
87
  if (backgroundColor.toLowerCase() !== ((_config$androidStatus2 = config.androidStatusBar) === null || _config$androidStatus2 === void 0 ? void 0 : (_config$androidStatus3 = _config$androidStatus2.backgroundColor) === null || _config$androidStatus3 === void 0 ? void 0 : (_config$androidStatus4 = _config$androidStatus3.toLowerCase) === null || _config$androidStatus4 === void 0 ? void 0 : _config$androidStatus4.call(_config$androidStatus3))) {
122
88
  _configPlugins().WarningAggregator.addWarningAndroid('androidStatusBar.backgroundColor', 'Color conflicts with the splash.backgroundColor');
123
89
  }
@@ -125,30 +91,22 @@ const withAndroidSplashScreen = config => {
125
91
  if (!config.androidStatusBar) config.androidStatusBar = {};
126
92
  config.androidStatusBar.backgroundColor = backgroundColor;
127
93
  }
128
-
129
94
  return (0, _configPlugins().withPlugins)(config, [_withAndroidSplashImages().withAndroidSplashImages, [_withAndroidSplashDrawables().withAndroidSplashDrawables, splashConfig], ...(shouldUpdateLegacyMainActivity(config) ? [_withAndroidSplashLegacyMainActivity().withAndroidSplashLegacyMainActivity] : []), _withAndroidSplashStyles().withAndroidSplashStyles, _withAndroidSplashStrings().withAndroidSplashStrings]);
130
95
  };
131
-
132
96
  exports.withAndroidSplashScreen = withAndroidSplashScreen;
133
-
134
97
  function shouldUpdateLegacyMainActivity(config) {
135
98
  try {
136
99
  var _config$_internal;
137
-
138
100
  const projectRoot = (_config$_internal = config._internal) === null || _config$_internal === void 0 ? void 0 : _config$_internal.projectRoot;
139
101
  const packagePath = (0, _resolveFrom().default)(projectRoot, 'expo-splash-screen/package.json');
140
-
141
102
  if (packagePath) {
142
103
  var _JsonFile$read$versio, _JsonFile$read$versio2;
143
-
144
104
  const version = (_JsonFile$read$versio = (_JsonFile$read$versio2 = _jsonFile().default.read(packagePath).version) === null || _JsonFile$read$versio2 === void 0 ? void 0 : _JsonFile$read$versio2.toString()) !== null && _JsonFile$read$versio !== void 0 ? _JsonFile$read$versio : '';
145
105
  return _semver().default.lt(version, '0.12.0');
146
- } // If expo-splash-screen didn't be installed or included in template, we check the sdkVersion instead.
147
-
148
-
106
+ }
107
+ // If expo-splash-screen didn't be installed or included in template, we check the sdkVersion instead.
149
108
  return !!(config.sdkVersion && _semver().default.lt(config.sdkVersion, '43.0.0'));
150
109
  } catch {}
151
-
152
110
  return false;
153
111
  }
154
112
  //# sourceMappingURL=withAndroidSplashScreen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withAndroidSplashScreen.js","names":["withAndroidSplashScreen","config","splashConfig","getAndroidSplashConfig","backgroundColor","androidStatusBar","toLowerCase","WarningAggregator","addWarningAndroid","withPlugins","withAndroidSplashImages","withAndroidSplashDrawables","shouldUpdateLegacyMainActivity","withAndroidSplashLegacyMainActivity","withAndroidSplashStyles","withAndroidSplashStrings","projectRoot","_internal","packagePath","resolveFrom","version","JsonFile","read","toString","semver","lt","sdkVersion"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withPlugins } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\nimport { withAndroidSplashDrawables } from './withAndroidSplashDrawables';\nimport { withAndroidSplashImages } from './withAndroidSplashImages';\nimport { withAndroidSplashLegacyMainActivity } from './withAndroidSplashLegacyMainActivity';\nimport { withAndroidSplashStrings } from './withAndroidSplashStrings';\nimport { withAndroidSplashStyles } from './withAndroidSplashStyles';\n\nexport const withAndroidSplashScreen: ConfigPlugin = (config) => {\n const splashConfig = getAndroidSplashConfig(config);\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 withAndroidSplashImages,\n [withAndroidSplashDrawables, splashConfig],\n ...(shouldUpdateLegacyMainActivity(config) ? [withAndroidSplashLegacyMainActivity] : []),\n withAndroidSplashStyles,\n withAndroidSplashStrings,\n ]);\n};\n\nfunction shouldUpdateLegacyMainActivity(config: ExpoConfig): boolean {\n try {\n const projectRoot = config._internal?.projectRoot;\n const packagePath = resolveFrom(projectRoot, 'expo-splash-screen/package.json');\n if (packagePath) {\n const version = JsonFile.read(packagePath).version?.toString() ?? '';\n return semver.lt(version, '0.12.0');\n }\n // If expo-splash-screen didn't be installed or included in template, we check the sdkVersion instead.\n return !!(config.sdkVersion && semver.lt(config.sdkVersion, '43.0.0'));\n } catch {}\n return false;\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;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;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H,WAAZ,EAAyB,iCAAzB,CAApB;;IACA,IAAIE,WAAJ,EAAiB;MAAA;;MACf,MAAME,OAAO,sDAAGC,mBAAA,CAASC,IAAT,CAAcJ,WAAd,EAA2BE,OAA9B,2DAAG,uBAAoCG,QAApC,EAAH,yEAAqD,EAAlE;MACA,OAAOC,iBAAA,CAAOC,EAAP,CAAUL,OAAV,EAAmB,QAAnB,CAAP;IACD,CANC,CAOF;;;IACA,OAAO,CAAC,EAAEnB,MAAM,CAACyB,UAAP,IAAqBF,iBAAA,CAAOC,EAAP,CAAUxB,MAAM,CAACyB,UAAjB,EAA6B,QAA7B,CAAvB,CAAR;EACD,CATD,CASE,MAAM,CAAE;;EACV,OAAO,KAAP;AACD"}
1
+ {"version":3,"file":"withAndroidSplashScreen.js","names":["withAndroidSplashScreen","config","splashConfig","getAndroidSplashConfig","backgroundColor","androidStatusBar","toLowerCase","WarningAggregator","addWarningAndroid","withPlugins","withAndroidSplashImages","withAndroidSplashDrawables","shouldUpdateLegacyMainActivity","withAndroidSplashLegacyMainActivity","withAndroidSplashStyles","withAndroidSplashStrings","projectRoot","_internal","packagePath","resolveFrom","version","JsonFile","read","toString","semver","lt","sdkVersion"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withPlugins } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\nimport { withAndroidSplashDrawables } from './withAndroidSplashDrawables';\nimport { withAndroidSplashImages } from './withAndroidSplashImages';\nimport { withAndroidSplashLegacyMainActivity } from './withAndroidSplashLegacyMainActivity';\nimport { withAndroidSplashStrings } from './withAndroidSplashStrings';\nimport { withAndroidSplashStyles } from './withAndroidSplashStyles';\n\nexport const withAndroidSplashScreen: ConfigPlugin = (config) => {\n const splashConfig = getAndroidSplashConfig(config);\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 withAndroidSplashImages,\n [withAndroidSplashDrawables, splashConfig],\n ...(shouldUpdateLegacyMainActivity(config) ? [withAndroidSplashLegacyMainActivity] : []),\n withAndroidSplashStyles,\n withAndroidSplashStrings,\n ]);\n};\n\nfunction shouldUpdateLegacyMainActivity(config: ExpoConfig): boolean {\n try {\n const projectRoot = config._internal?.projectRoot;\n const packagePath = resolveFrom(projectRoot, 'expo-splash-screen/package.json');\n if (packagePath) {\n const version = JsonFile.read(packagePath).version?.toString() ?? '';\n return semver.lt(version, '0.12.0');\n }\n // If expo-splash-screen didn't be installed or included in template, we check the sdkVersion instead.\n return !!(config.sdkVersion && semver.lt(config.sdkVersion, '43.0.0'));\n } catch {}\n return false;\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;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;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AAQ,EAAE,yEAAI,EAAE;MACpE,OAAOC,iBAAM,CAACC,EAAE,CAACL,OAAO,EAAE,QAAQ,CAAC;IACrC;IACA;IACA,OAAO,CAAC,EAAEnB,MAAM,CAACyB,UAAU,IAAIF,iBAAM,CAACC,EAAE,CAACxB,MAAM,CAACyB,UAAU,EAAE,QAAQ,CAAC,CAAC;EACxE,CAAC,CAAC,MAAM,CAAC;EACT,OAAO,KAAK;AACd"}
@@ -5,50 +5,37 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.setSplashStrings = setSplashStrings;
7
7
  exports.withAndroidSplashStrings = 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 _getAndroidSplashConfig() {
20
16
  const data = require("./getAndroidSplashConfig");
21
-
22
17
  _getAndroidSplashConfig = function () {
23
18
  return data;
24
19
  };
25
-
26
20
  return data;
27
21
  }
28
-
29
22
  const RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';
30
23
  const STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';
31
-
32
24
  const withAndroidSplashStrings = config => {
33
25
  return (0, _configPlugins().withStringsXml)(config, config => {
34
26
  const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
35
-
36
27
  if (splashConfig) {
37
28
  var _config$androidStatus;
38
-
39
29
  const {
40
30
  resizeMode
41
31
  } = splashConfig;
42
32
  const statusBarTranslucent = !!((_config$androidStatus = config.androidStatusBar) !== null && _config$androidStatus !== void 0 && _config$androidStatus.translucent);
43
33
  config.modResults = setSplashStrings(config.modResults, resizeMode, statusBarTranslucent);
44
34
  }
45
-
46
35
  return config;
47
36
  });
48
37
  };
49
-
50
38
  exports.withAndroidSplashStrings = withAndroidSplashStrings;
51
-
52
39
  function setSplashStrings(strings, resizeMode, statusBarTranslucent) {
53
40
  return _configPlugins().AndroidConfig.Strings.setStringItem([_configPlugins().AndroidConfig.Resources.buildResourceItem({
54
41
  name: RESIZE_MODE_KEY,
@@ -1 +1 @@
1
- {"version":3,"file":"withAndroidSplashStrings.js","names":["RESIZE_MODE_KEY","STATUS_BAR_TRANSLUCENT_KEY","withAndroidSplashStrings","config","withStringsXml","splashConfig","getAndroidSplashConfig","resizeMode","statusBarTranslucent","androidStatusBar","translucent","modResults","setSplashStrings","strings","AndroidConfig","Strings","setStringItem","Resources","buildResourceItem","name","value","translatable","String"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withStringsXml } from '@expo/config-plugins';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';\nconst STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';\n\nexport const withAndroidSplashStrings: ConfigPlugin = (config) => {\n return withStringsXml(config, (config) => {\n const splashConfig = getAndroidSplashConfig(config);\n if (splashConfig) {\n const { resizeMode } = splashConfig;\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n config.modResults = setSplashStrings(config.modResults, resizeMode, statusBarTranslucent);\n }\n return config;\n });\n};\n\nexport function setSplashStrings(\n strings: AndroidConfig.Resources.ResourceXML,\n resizeMode: string,\n statusBarTranslucent: boolean\n): AndroidConfig.Resources.ResourceXML {\n return AndroidConfig.Strings.setStringItem(\n [\n AndroidConfig.Resources.buildResourceItem({\n name: RESIZE_MODE_KEY,\n value: resizeMode,\n translatable: false,\n }),\n AndroidConfig.Resources.buildResourceItem({\n name: STATUS_BAR_TRANSLUCENT_KEY,\n value: String(statusBarTranslucent),\n translatable: false,\n }),\n ],\n strings\n );\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA,MAAMA,eAAe,GAAG,gCAAxB;AACA,MAAMC,0BAA0B,GAAG,2CAAnC;;AAEO,MAAMC,wBAAsC,GAAIC,MAAD,IAAY;EAChE,OAAO,IAAAC,+BAAA,EAAeD,MAAf,EAAwBA,MAAD,IAAY;IACxC,MAAME,YAAY,GAAG,IAAAC,gDAAA,EAAuBH,MAAvB,CAArB;;IACA,IAAIE,YAAJ,EAAkB;MAAA;;MAChB,MAAM;QAAEE;MAAF,IAAiBF,YAAvB;MACA,MAAMG,oBAAoB,GAAG,CAAC,2BAACL,MAAM,CAACM,gBAAR,kDAAC,sBAAyBC,WAA1B,CAA9B;MACAP,MAAM,CAACQ,UAAP,GAAoBC,gBAAgB,CAACT,MAAM,CAACQ,UAAR,EAAoBJ,UAApB,EAAgCC,oBAAhC,CAApC;IACD;;IACD,OAAOL,MAAP;EACD,CARM,CAAP;AASD,CAVM;;;;AAYA,SAASS,gBAAT,CACLC,OADK,EAELN,UAFK,EAGLC,oBAHK,EAIgC;EACrC,OAAOM,8BAAA,CAAcC,OAAd,CAAsBC,aAAtB,CACL,CACEF,8BAAA,CAAcG,SAAd,CAAwBC,iBAAxB,CAA0C;IACxCC,IAAI,EAAEnB,eADkC;IAExCoB,KAAK,EAAEb,UAFiC;IAGxCc,YAAY,EAAE;EAH0B,CAA1C,CADF,EAMEP,8BAAA,CAAcG,SAAd,CAAwBC,iBAAxB,CAA0C;IACxCC,IAAI,EAAElB,0BADkC;IAExCmB,KAAK,EAAEE,MAAM,CAACd,oBAAD,CAF2B;IAGxCa,YAAY,EAAE;EAH0B,CAA1C,CANF,CADK,EAaLR,OAbK,CAAP;AAeD"}
1
+ {"version":3,"file":"withAndroidSplashStrings.js","names":["RESIZE_MODE_KEY","STATUS_BAR_TRANSLUCENT_KEY","withAndroidSplashStrings","config","withStringsXml","splashConfig","getAndroidSplashConfig","resizeMode","statusBarTranslucent","androidStatusBar","translucent","modResults","setSplashStrings","strings","AndroidConfig","Strings","setStringItem","Resources","buildResourceItem","name","value","translatable","String"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withStringsXml } from '@expo/config-plugins';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';\nconst STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';\n\nexport const withAndroidSplashStrings: ConfigPlugin = (config) => {\n return withStringsXml(config, (config) => {\n const splashConfig = getAndroidSplashConfig(config);\n if (splashConfig) {\n const { resizeMode } = splashConfig;\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n config.modResults = setSplashStrings(config.modResults, resizeMode, statusBarTranslucent);\n }\n return config;\n });\n};\n\nexport function setSplashStrings(\n strings: AndroidConfig.Resources.ResourceXML,\n resizeMode: string,\n statusBarTranslucent: boolean\n): AndroidConfig.Resources.ResourceXML {\n return AndroidConfig.Strings.setStringItem(\n [\n AndroidConfig.Resources.buildResourceItem({\n name: RESIZE_MODE_KEY,\n value: resizeMode,\n translatable: false,\n }),\n AndroidConfig.Resources.buildResourceItem({\n name: STATUS_BAR_TRANSLUCENT_KEY,\n value: String(statusBarTranslucent),\n translatable: false,\n }),\n ],\n strings\n );\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,eAAe,GAAG,gCAAgC;AACxD,MAAMC,0BAA0B,GAAG,2CAA2C;AAEvE,MAAMC,wBAAsC,GAAIC,MAAM,IAAK;EAChE,OAAO,IAAAC,+BAAc,EAACD,MAAM,EAAGA,MAAM,IAAK;IACxC,MAAME,YAAY,GAAG,IAAAC,gDAAsB,EAACH,MAAM,CAAC;IACnD,IAAIE,YAAY,EAAE;MAAA;MAChB,MAAM;QAAEE;MAAW,CAAC,GAAGF,YAAY;MACnC,MAAMG,oBAAoB,GAAG,CAAC,2BAACL,MAAM,CAACM,gBAAgB,kDAAvB,sBAAyBC,WAAW;MACnEP,MAAM,CAACQ,UAAU,GAAGC,gBAAgB,CAACT,MAAM,CAACQ,UAAU,EAAEJ,UAAU,EAAEC,oBAAoB,CAAC;IAC3F;IACA,OAAOL,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC;AAEK,SAASS,gBAAgB,CAC9BC,OAA4C,EAC5CN,UAAkB,EAClBC,oBAA6B,EACQ;EACrC,OAAOM,8BAAa,CAACC,OAAO,CAACC,aAAa,CACxC,CACEF,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAEnB,eAAe;IACrBoB,KAAK,EAAEb,UAAU;IACjBc,YAAY,EAAE;EAChB,CAAC,CAAC,EACFP,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAElB,0BAA0B;IAChCmB,KAAK,EAAEE,MAAM,CAACd,oBAAoB,CAAC;IACnCa,YAAY,EAAE;EAChB,CAAC,CAAC,CACH,EACDR,OAAO,CACR;AACH"}
@@ -9,43 +9,32 @@ exports.removeOldSplashStyleGroup = removeOldSplashStyleGroup;
9
9
  exports.setSplashColorsForTheme = setSplashColorsForTheme;
10
10
  exports.setSplashStylesForTheme = setSplashStylesForTheme;
11
11
  exports.withAndroidSplashStyles = void 0;
12
-
13
12
  function _configPlugins() {
14
13
  const data = require("@expo/config-plugins");
15
-
16
14
  _configPlugins = function () {
17
15
  return data;
18
16
  };
19
-
20
17
  return data;
21
18
  }
22
-
23
19
  function _android() {
24
20
  const data = require("@expo/config-plugins/build/android");
25
-
26
21
  _android = function () {
27
22
  return data;
28
23
  };
29
-
30
24
  return data;
31
25
  }
32
-
33
26
  function _getAndroidSplashConfig() {
34
27
  const data = require("./getAndroidSplashConfig");
35
-
36
28
  _getAndroidSplashConfig = function () {
37
29
  return data;
38
30
  };
39
-
40
31
  return data;
41
32
  }
42
-
43
33
  const styleResourceGroup = {
44
34
  name: 'Theme.App.SplashScreen',
45
35
  parent: 'AppTheme'
46
36
  };
47
37
  const SPLASH_COLOR_NAME = 'splashscreen_background';
48
-
49
38
  const withAndroidSplashStyles = config => {
50
39
  config = (0, _configPlugins().withAndroidColors)(config, config => {
51
40
  const backgroundColor = getSplashBackgroundColor(config);
@@ -63,14 +52,12 @@ const withAndroidSplashStyles = config => {
63
52
  return config;
64
53
  });
65
54
  return config;
66
- }; // Remove the old style group which didn't extend the base theme properly.
67
-
55
+ };
68
56
 
57
+ // Remove the old style group which didn't extend the base theme properly.
69
58
  exports.withAndroidSplashStyles = withAndroidSplashStyles;
70
-
71
59
  function removeOldSplashStyleGroup(styles) {
72
60
  var _styles$resources$sty, _styles$resources$sty2;
73
-
74
61
  const group = {
75
62
  name: 'Theme.App.SplashScreen',
76
63
  parent: 'Theme.AppCompat.Light.NoActionBar'
@@ -79,28 +66,21 @@ function removeOldSplashStyleGroup(styles) {
79
66
  $: head
80
67
  }) => {
81
68
  let matches = head.name === group.name;
82
-
83
69
  if (group.parent != null && matches) {
84
70
  matches = head.parent === group.parent;
85
71
  }
86
-
87
72
  return !matches;
88
73
  });
89
74
  return styles;
90
75
  }
91
-
92
76
  function getSplashBackgroundColor(config) {
93
77
  var _getAndroidSplashConf, _getAndroidSplashConf2;
94
-
95
78
  return (_getAndroidSplashConf = (_getAndroidSplashConf2 = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config)) === null || _getAndroidSplashConf2 === void 0 ? void 0 : _getAndroidSplashConf2.backgroundColor) !== null && _getAndroidSplashConf !== void 0 ? _getAndroidSplashConf : null;
96
79
  }
97
-
98
80
  function getSplashDarkBackgroundColor(config) {
99
81
  var _getAndroidDarkSplash, _getAndroidDarkSplash2;
100
-
101
82
  return (_getAndroidDarkSplash = (_getAndroidDarkSplash2 = (0, _getAndroidSplashConfig().getAndroidDarkSplashConfig)(config)) === null || _getAndroidDarkSplash2 === void 0 ? void 0 : _getAndroidDarkSplash2.backgroundColor) !== null && _getAndroidDarkSplash !== void 0 ? _getAndroidDarkSplash : null;
102
83
  }
103
-
104
84
  function setSplashStylesForTheme(styles) {
105
85
  // Add splash screen image
106
86
  return _configPlugins().AndroidConfig.Styles.assignStylesValue(styles, {
@@ -110,7 +90,6 @@ function setSplashStylesForTheme(styles) {
110
90
  parent: styleResourceGroup
111
91
  });
112
92
  }
113
-
114
93
  function setSplashColorsForTheme(colors, backgroundColor) {
115
94
  return _android().Colors.assignColorValue(colors, {
116
95
  value: backgroundColor,
@@ -1 +1 @@
1
- {"version":3,"file":"withAndroidSplashStyles.js","names":["styleResourceGroup","name","parent","SPLASH_COLOR_NAME","withAndroidSplashStyles","config","withAndroidColors","backgroundColor","getSplashBackgroundColor","modResults","setSplashColorsForTheme","withAndroidColorsNight","getSplashDarkBackgroundColor","withAndroidStyles","removeOldSplashStyleGroup","setSplashStylesForTheme","styles","group","resources","style","filter","$","head","matches","getAndroidSplashConfig","getAndroidDarkSplashConfig","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 { getAndroidDarkSplashConfig, getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst styleResourceGroup = {\n name: 'Theme.App.SplashScreen',\n parent: 'AppTheme',\n};\n\nconst SPLASH_COLOR_NAME = 'splashscreen_background';\n\nexport const withAndroidSplashStyles: ConfigPlugin = (config) => {\n config = withAndroidColors(config, (config) => {\n const backgroundColor = getSplashBackgroundColor(config);\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidColorsNight(config, (config) => {\n const backgroundColor = getSplashDarkBackgroundColor(config);\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 = setSplashStylesForTheme(config.modResults);\n return config;\n });\n return config;\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(config: ExpoConfig): string | null {\n return getAndroidSplashConfig(config)?.backgroundColor ?? null;\n}\n\nexport function getSplashDarkBackgroundColor(config: ExpoConfig): string | null {\n return getAndroidDarkSplashConfig(config)?.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',\n name: 'android:windowBackground',\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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAOA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA,MAAMA,kBAAkB,GAAG;EACzBC,IAAI,EAAE,wBADmB;EAEzBC,MAAM,EAAE;AAFiB,CAA3B;AAKA,MAAMC,iBAAiB,GAAG,yBAA1B;;AAEO,MAAMC,uBAAqC,GAAIC,MAAD,IAAY;EAC/DA,MAAM,G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,OAAO,GAAGD,IAAI,CAACpB,MAAL,KAAgBe,KAAK,CAACf,MAAhC;IACD;;IACD,OAAO,CAACqB,OAAR;EACD,CANwB,CAAzB;EAQA,OAAOP,MAAP;AACD;;AAEM,SAASR,wBAAT,CAAkCH,MAAlC,EAAqE;EAAA;;EAC1E,0DAAO,IAAAmB,gDAAA,EAAuBnB,MAAvB,CAAP,2DAAO,uBAAgCE,eAAvC,yEAA0D,IAA1D;AACD;;AAEM,SAASK,4BAAT,CAAsCP,MAAtC,EAAyE;EAAA;;EAC9E,0DAAO,IAAAoB,oDAAA,EAA2BpB,MAA3B,CAAP,2DAAO,uBAAoCE,eAA3C,yEAA8D,IAA9D;AACD;;AAEM,SAASQ,uBAAT,CAAiCC,MAAjC,EAA8E;EACnF;EACA,OAAOU,8BAAA,CAAcC,MAAd,CAAqBC,iBAArB,CAAuCZ,MAAvC,EAA+C;IACpDa,GAAG,EAAE,IAD+C;IAEpDC,KAAK,EAAE,wBAF6C;IAGpD7B,IAAI,EAAE,0BAH8C;IAIpDC,MAAM,EAAEF;EAJ4C,CAA/C,CAAP;AAMD;;AAEM,SAASU,uBAAT,CACLqB,MADK,EAELxB,eAFK,EAGgC;EACrC,OAAOyB,iBAAA,CAAOC,gBAAP,CAAwBF,MAAxB,EAAgC;IAAED,KAAK,EAAEvB,eAAT;IAA0BN,IAAI,EAAEE;EAAhC,CAAhC,CAAP;AACD"}
1
+ {"version":3,"file":"withAndroidSplashStyles.js","names":["styleResourceGroup","name","parent","SPLASH_COLOR_NAME","withAndroidSplashStyles","config","withAndroidColors","backgroundColor","getSplashBackgroundColor","modResults","setSplashColorsForTheme","withAndroidColorsNight","getSplashDarkBackgroundColor","withAndroidStyles","removeOldSplashStyleGroup","setSplashStylesForTheme","styles","group","resources","style","filter","$","head","matches","getAndroidSplashConfig","getAndroidDarkSplashConfig","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 { getAndroidDarkSplashConfig, getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst styleResourceGroup = {\n name: 'Theme.App.SplashScreen',\n parent: 'AppTheme',\n};\n\nconst SPLASH_COLOR_NAME = 'splashscreen_background';\n\nexport const withAndroidSplashStyles: ConfigPlugin = (config) => {\n config = withAndroidColors(config, (config) => {\n const backgroundColor = getSplashBackgroundColor(config);\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidColorsNight(config, (config) => {\n const backgroundColor = getSplashDarkBackgroundColor(config);\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 = setSplashStylesForTheme(config.modResults);\n return config;\n });\n return config;\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(config: ExpoConfig): string | null {\n return getAndroidSplashConfig(config)?.backgroundColor ?? null;\n}\n\nexport function getSplashDarkBackgroundColor(config: ExpoConfig): string | null {\n return getAndroidDarkSplashConfig(config)?.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',\n name: 'android:windowBackground',\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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,kBAAkB,GAAG;EACzBC,IAAI,EAAE,wBAAwB;EAC9BC,MAAM,EAAE;AACV,CAAC;AAED,MAAMC,iBAAiB,GAAG,yBAAyB;AAE5C,MAAMC,uBAAqC,GAAIC,MAAM,IAAK;EAC/DA,MAAM,GAAG,IAAAC,kCAAiB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC7C,MAAME,eAAe,GAAGC,wBAAwB,CAACH,MAAM,CAAC;IACxDA,MAAM,CAACI,UAAU,GAAGC,uBAAuB,CAACL,MAAM,CAACI,UAAU,EAAEF,eAAe,CAAC;IAC/E,OAAOF,MAAM;EACf,CAAC,CAAC;EACFA,MAAM,GAAG,IAAAM,uCAAsB,EAACN,MAAM,EAAGA,MAAM,IAAK;IAClD,MAAME,eAAe,GAAGK,4BAA4B,CAACP,MAAM,CAAC;IAC5DA,MAAM,CAACI,UAAU,GAAGC,uBAAuB,CAACL,MAAM,CAACI,UAAU,EAAEF,eAAe,CAAC;IAC/E,OAAOF,MAAM;EACf,CAAC,CAAC;EACFA,MAAM,GAAG,IAAAQ,kCAAiB,EAACR,MAAM,EAAGA,MAAM,IAAK;IAC7CA,MAAM,CAACI,UAAU,GAAGK,yBAAyB,CAACT,MAAM,CAACI,UAAU,CAAC;IAChEJ,MAAM,CAACI,UAAU,GAAGM,uBAAuB,CAACV,MAAM,CAACI,UAAU,CAAC;IAC9D,OAAOJ,MAAM;EACf,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