@expo/prebuild-config 8.0.5 → 8.0.7

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 (44) hide show
  1. package/build/plugins/icons/withAndroidIcons.d.ts +1 -1
  2. package/build/plugins/icons/withAndroidIcons.js +46 -27
  3. package/build/plugins/icons/withAndroidIcons.js.map +1 -1
  4. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.d.ts +23 -5
  5. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js +47 -10
  6. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js.map +1 -1
  7. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.d.ts +21 -7
  8. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js +29 -3
  9. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js.map +1 -1
  10. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.d.ts +1 -0
  11. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js.map +1 -1
  12. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js +2 -2
  13. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js.map +1 -1
  14. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.d.ts +4 -4
  15. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js +33 -19
  16. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
  17. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.d.ts +3 -2
  18. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js +5 -5
  19. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map +1 -1
  20. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.d.ts +3 -0
  21. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.js +58 -0
  22. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.js.map +1 -0
  23. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.d.ts +2 -1
  24. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js +6 -41
  25. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js.map +1 -1
  26. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.d.ts +2 -1
  27. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js +2 -2
  28. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js.map +1 -1
  29. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.d.ts +4 -3
  30. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js +45 -10
  31. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js.map +1 -1
  32. package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js +46 -67
  33. package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js.map +1 -1
  34. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js +11 -8
  35. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js.map +1 -1
  36. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js +31 -64
  37. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js.map +1 -1
  38. package/build/plugins/unversioned/expo-splash-screen/{wtihIosSplashScreenStoryboardImage.js → withIosSplashScreenStoryboardImage.js} +7 -5
  39. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboardImage.js.map +1 -0
  40. package/build/plugins/withDefaultPlugins.js +1 -1
  41. package/build/plugins/withDefaultPlugins.js.map +1 -1
  42. package/package.json +2 -2
  43. package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js.map +0 -1
  44. /package/build/plugins/unversioned/expo-splash-screen/{wtihIosSplashScreenStoryboardImage.d.ts → withIosSplashScreenStoryboardImage.d.ts} +0 -0
@@ -1,3 +1,4 @@
1
1
  import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
2
- export declare const withAndroidSplashStrings: ConfigPlugin;
2
+ import { AndroidSplashConfig } from './getAndroidSplashConfig';
3
+ export declare const withAndroidSplashStrings: ConfigPlugin<AndroidSplashConfig>;
3
4
  export declare function setSplashStrings(strings: AndroidConfig.Resources.ResourceXML, resizeMode: string, statusBarTranslucent: boolean): AndroidConfig.Resources.ResourceXML;
@@ -21,9 +21,9 @@ function _getAndroidSplashConfig() {
21
21
  }
22
22
  const RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';
23
23
  const STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';
24
- const withAndroidSplashStrings = config => {
24
+ const withAndroidSplashStrings = (config, props) => {
25
25
  return (0, _configPlugins().withStringsXml)(config, config => {
26
- const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
26
+ const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config, props);
27
27
  if (splashConfig) {
28
28
  const {
29
29
  resizeMode
@@ -1 +1 @@
1
- {"version":3,"file":"withAndroidSplashStrings.js","names":["_configPlugins","data","require","_getAndroidSplashConfig","RESIZE_MODE_KEY","STATUS_BAR_TRANSLUCENT_KEY","withAndroidSplashStrings","config","withStringsXml","splashConfig","getAndroidSplashConfig","resizeMode","statusBarTranslucent","androidStatusBar","translucent","modResults","setSplashStrings","exports","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,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,wBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,uBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,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;MAChB,MAAM;QAAEE;MAAW,CAAC,GAAGF,YAAY;MACnC,MAAMG,oBAAoB,GAAG,CAAC,CAACL,MAAM,CAACM,gBAAgB,EAAEC,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;AAACU,OAAA,CAAAX,wBAAA,GAAAA,wBAAA;AAEK,SAASU,gBAAgBA,CAC9BE,OAA4C,EAC5CP,UAAkB,EAClBC,oBAA6B,EACQ;EACrC,OAAOO,8BAAa,CAACC,OAAO,CAACC,aAAa,CACxC,CACEF,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAEpB,eAAe;IACrBqB,KAAK,EAAEd,UAAU;IACjBe,YAAY,EAAE;EAChB,CAAC,CAAC,EACFP,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAEnB,0BAA0B;IAChCoB,KAAK,EAAEE,MAAM,CAACf,oBAAoB,CAAC;IACnCc,YAAY,EAAE;EAChB,CAAC,CAAC,CACH,EACDR,OACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"withAndroidSplashStrings.js","names":["_configPlugins","data","require","_getAndroidSplashConfig","RESIZE_MODE_KEY","STATUS_BAR_TRANSLUCENT_KEY","withAndroidSplashStrings","config","props","withStringsXml","splashConfig","getAndroidSplashConfig","resizeMode","statusBarTranslucent","androidStatusBar","translucent","modResults","setSplashStrings","exports","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 { AndroidSplashConfig, 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<AndroidSplashConfig> = (config, props) => {\n return withStringsXml(config, (config) => {\n const splashConfig = getAndroidSplashConfig(config, props);\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,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,wBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,uBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,eAAe,GAAG,gCAAgC;AACxD,MAAMC,0BAA0B,GAAG,2CAA2C;AAEvE,MAAMC,wBAA2D,GAAGA,CAACC,MAAM,EAAEC,KAAK,KAAK;EAC5F,OAAO,IAAAC,+BAAc,EAACF,MAAM,EAAGA,MAAM,IAAK;IACxC,MAAMG,YAAY,GAAG,IAAAC,gDAAsB,EAACJ,MAAM,EAAEC,KAAK,CAAC;IAC1D,IAAIE,YAAY,EAAE;MAChB,MAAM;QAAEE;MAAW,CAAC,GAAGF,YAAY;MACnC,MAAMG,oBAAoB,GAAG,CAAC,CAACN,MAAM,CAACO,gBAAgB,EAAEC,WAAW;MACnER,MAAM,CAACS,UAAU,GAAGC,gBAAgB,CAACV,MAAM,CAACS,UAAU,EAAEJ,UAAU,EAAEC,oBAAoB,CAAC;IAC3F;IACA,OAAON,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACW,OAAA,CAAAZ,wBAAA,GAAAA,wBAAA;AAEK,SAASW,gBAAgBA,CAC9BE,OAA4C,EAC5CP,UAAkB,EAClBC,oBAA6B,EACQ;EACrC,OAAOO,8BAAa,CAACC,OAAO,CAACC,aAAa,CACxC,CACEF,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAErB,eAAe;IACrBsB,KAAK,EAAEd,UAAU;IACjBe,YAAY,EAAE;EAChB,CAAC,CAAC,EACFP,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAEpB,0BAA0B;IAChCqB,KAAK,EAAEE,MAAM,CAACf,oBAAoB,CAAC;IACnCc,YAAY,EAAE;EAChB,CAAC,CAAC,CACH,EACDR,OACF,CAAC;AACH","ignoreList":[]}
@@ -1,8 +1,9 @@
1
1
  import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
2
2
  import { ExpoConfig } from '@expo/config-types';
3
- export declare const withAndroidSplashStyles: ConfigPlugin;
3
+ import { AndroidSplashConfig } from './getAndroidSplashConfig';
4
+ export declare const withAndroidSplashStyles: ConfigPlugin<AndroidSplashConfig>;
4
5
  export declare function removeOldSplashStyleGroup(styles: AndroidConfig.Resources.ResourceXML): AndroidConfig.Resources.ResourceXML;
5
- export declare function getSplashBackgroundColor(config: ExpoConfig): string | null;
6
- export declare function getSplashDarkBackgroundColor(config: ExpoConfig): string | null;
6
+ export declare function getSplashBackgroundColor(config: ExpoConfig, props: AndroidSplashConfig | null): string | null;
7
+ export declare function getSplashDarkBackgroundColor(config: ExpoConfig, props: AndroidSplashConfig | null): string | null;
7
8
  export declare function setSplashStylesForTheme(styles: AndroidConfig.Resources.ResourceXML): AndroidConfig.Resources.ResourceXML;
8
9
  export declare function setSplashColorsForTheme(colors: AndroidConfig.Resources.ResourceXML, backgroundColor: string | null): AndroidConfig.Resources.ResourceXML;
@@ -32,12 +32,12 @@ function _getAndroidSplashConfig() {
32
32
  }
33
33
  const styleResourceGroup = {
34
34
  name: 'Theme.App.SplashScreen',
35
- parent: 'AppTheme'
35
+ parent: 'Theme.SplashScreen'
36
36
  };
37
37
  const SPLASH_COLOR_NAME = 'splashscreen_background';
38
- const withAndroidSplashStyles = config => {
38
+ const withAndroidSplashStyles = (config, props) => {
39
39
  config = (0, _configPlugins().withAndroidColors)(config, config => {
40
- const backgroundColor = getSplashBackgroundColor(config);
40
+ const backgroundColor = getSplashBackgroundColor(config, props);
41
41
  if (!backgroundColor) {
42
42
  return config;
43
43
  }
@@ -45,7 +45,7 @@ const withAndroidSplashStyles = config => {
45
45
  return config;
46
46
  });
47
47
  config = (0, _configPlugins().withAndroidColorsNight)(config, config => {
48
- const backgroundColor = getSplashDarkBackgroundColor(config);
48
+ const backgroundColor = getSplashDarkBackgroundColor(config, props);
49
49
  if (!backgroundColor) {
50
50
  return config;
51
51
  }
@@ -54,14 +54,49 @@ const withAndroidSplashStyles = config => {
54
54
  });
55
55
  config = (0, _configPlugins().withAndroidStyles)(config, config => {
56
56
  config.modResults = removeOldSplashStyleGroup(config.modResults);
57
- config.modResults = setSplashStylesForTheme(config.modResults);
57
+ config.modResults = addSplashScreenStyle(config.modResults);
58
58
  return config;
59
59
  });
60
60
  return config;
61
61
  };
62
62
 
63
- // Remove the old style group which didn't extend the base theme properly.
63
+ // Add the style that extends Theme.SplashScreen
64
64
  exports.withAndroidSplashStyles = withAndroidSplashStyles;
65
+ function addSplashScreenStyle(styles) {
66
+ const {
67
+ resources
68
+ } = styles;
69
+ const {
70
+ style = []
71
+ } = resources;
72
+ const item = [{
73
+ $: {
74
+ name: 'windowSplashScreenBackground'
75
+ },
76
+ _: '@color/splashscreen_background'
77
+ }, {
78
+ $: {
79
+ name: 'windowSplashScreenAnimatedIcon'
80
+ },
81
+ _: '@drawable/splashscreen_logo'
82
+ }, {
83
+ $: {
84
+ name: 'postSplashScreenTheme'
85
+ },
86
+ _: '@style/AppTheme'
87
+ }];
88
+ styles.resources.style = [...style.filter(({
89
+ $
90
+ }) => $.name !== 'Theme.App.SplashScreen'), {
91
+ $: {
92
+ ...styleResourceGroup
93
+ },
94
+ item
95
+ }];
96
+ return styles;
97
+ }
98
+
99
+ // Remove the old style group which didn't extend the base theme properly.
65
100
  function removeOldSplashStyleGroup(styles) {
66
101
  const group = {
67
102
  name: 'Theme.App.SplashScreen',
@@ -78,11 +113,11 @@ function removeOldSplashStyleGroup(styles) {
78
113
  });
79
114
  return styles;
80
115
  }
81
- function getSplashBackgroundColor(config) {
82
- return (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config)?.backgroundColor ?? null;
116
+ function getSplashBackgroundColor(config, props) {
117
+ return (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config, props)?.backgroundColor ?? null;
83
118
  }
84
- function getSplashDarkBackgroundColor(config) {
85
- return (0, _getAndroidSplashConfig().getAndroidDarkSplashConfig)(config)?.backgroundColor ?? null;
119
+ function getSplashDarkBackgroundColor(config, props) {
120
+ return (0, _getAndroidSplashConfig().getAndroidDarkSplashConfig)(config, props)?.backgroundColor ?? null;
86
121
  }
87
122
  function setSplashStylesForTheme(styles) {
88
123
  // Add splash screen image
@@ -1 +1 @@
1
- {"version":3,"file":"withAndroidSplashStyles.js","names":["_configPlugins","data","require","_android","_getAndroidSplashConfig","styleResourceGroup","name","parent","SPLASH_COLOR_NAME","withAndroidSplashStyles","config","withAndroidColors","backgroundColor","getSplashBackgroundColor","modResults","setSplashColorsForTheme","withAndroidColorsNight","getSplashDarkBackgroundColor","withAndroidStyles","removeOldSplashStyleGroup","setSplashStylesForTheme","exports","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 if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidColorsNight(config, (config) => {\n const backgroundColor = getSplashDarkBackgroundColor(config);\n if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidStyles(config, (config) => {\n config.modResults = removeOldSplashStyleGroup(config.modResults);\n config.modResults = 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,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,wBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,uBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMI,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;IACxD,IAAI,CAACE,eAAe,EAAE;MACpB,OAAOF,MAAM;IACf;IACAA,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;IAC5D,IAAI,CAACE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M,CAAC,EAAEE,eAAe,IAAI,IAAI;AACpE;AAEO,SAASQ,uBAAuBA,CAACE,MAA2C,EAAE;EACnF;EACA,OAAOU,8BAAa,CAACC,MAAM,CAACC,iBAAiB,CAACZ,MAAM,EAAE;IACpDa,GAAG,EAAE,IAAI;IACTC,KAAK,EAAE,wBAAwB;IAC/B9B,IAAI,EAAE,0BAA0B;IAChCC,MAAM,EAAEF;EACV,CAAC,CAAC;AACJ;AAEO,SAASU,uBAAuBA,CACrCsB,MAA2C,EAC3CzB,eAA8B,EACO;EACrC,OAAO0B,iBAAM,CAACC,gBAAgB,CAACF,MAAM,EAAE;IAAED,KAAK,EAAExB,eAAe;IAAEN,IAAI,EAAEE;EAAkB,CAAC,CAAC;AAC7F","ignoreList":[]}
1
+ {"version":3,"file":"withAndroidSplashStyles.js","names":["_configPlugins","data","require","_android","_getAndroidSplashConfig","styleResourceGroup","name","parent","SPLASH_COLOR_NAME","withAndroidSplashStyles","config","props","withAndroidColors","backgroundColor","getSplashBackgroundColor","modResults","setSplashColorsForTheme","withAndroidColorsNight","getSplashDarkBackgroundColor","withAndroidStyles","removeOldSplashStyleGroup","addSplashScreenStyle","exports","styles","resources","style","item","$","_","filter","group","head","matches","getAndroidSplashConfig","getAndroidDarkSplashConfig","setSplashStylesForTheme","AndroidConfig","Styles","assignStylesValue","add","value","colors","Colors","assignColorValue"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { Colors } from '@expo/config-plugins/build/android';\nimport { ExpoConfig } from '@expo/config-types';\n\nimport {\n AndroidSplashConfig,\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n} from './getAndroidSplashConfig';\n\nconst styleResourceGroup = {\n name: 'Theme.App.SplashScreen',\n parent: 'Theme.SplashScreen',\n};\n\nconst SPLASH_COLOR_NAME = 'splashscreen_background';\n\nexport const withAndroidSplashStyles: ConfigPlugin<AndroidSplashConfig> = (config, props) => {\n config = withAndroidColors(config, (config) => {\n const backgroundColor = getSplashBackgroundColor(config, props);\n if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidColorsNight(config, (config) => {\n const backgroundColor = getSplashDarkBackgroundColor(config, props);\n if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidStyles(config, (config) => {\n config.modResults = removeOldSplashStyleGroup(config.modResults);\n config.modResults = addSplashScreenStyle(config.modResults);\n return config;\n });\n return config;\n};\n\n// Add the style that extends Theme.SplashScreen\nfunction addSplashScreenStyle(styles: AndroidConfig.Resources.ResourceXML) {\n const { resources } = styles;\n const { style = [] } = resources;\n\n const item = [\n {\n $: { name: 'windowSplashScreenBackground' },\n _: '@color/splashscreen_background',\n },\n {\n $: { name: 'windowSplashScreenAnimatedIcon' },\n _: '@drawable/splashscreen_logo',\n },\n {\n $: { name: 'postSplashScreenTheme' },\n _: '@style/AppTheme',\n },\n ];\n\n styles.resources.style = [\n ...style.filter(({ $ }) => $.name !== 'Theme.App.SplashScreen'),\n {\n $: {\n ...styleResourceGroup,\n },\n item,\n },\n ];\n\n return styles;\n}\n\n// Remove the old style group which didn't extend the base theme properly.\nexport function removeOldSplashStyleGroup(styles: AndroidConfig.Resources.ResourceXML) {\n const group = {\n name: 'Theme.App.SplashScreen',\n parent: 'Theme.AppCompat.Light.NoActionBar',\n };\n\n styles.resources.style = styles.resources.style?.filter?.(({ $: head }) => {\n let matches = head.name === group.name;\n if (group.parent != null && matches) {\n matches = head.parent === group.parent;\n }\n return !matches;\n });\n\n return styles;\n}\n\nexport function getSplashBackgroundColor(\n config: ExpoConfig,\n props: AndroidSplashConfig | null\n): string | null {\n return getAndroidSplashConfig(config, props)?.backgroundColor ?? null;\n}\n\nexport function getSplashDarkBackgroundColor(\n config: ExpoConfig,\n props: AndroidSplashConfig | null\n): string | null {\n return getAndroidDarkSplashConfig(config, props)?.backgroundColor ?? null;\n}\n\nexport function setSplashStylesForTheme(styles: AndroidConfig.Resources.ResourceXML) {\n // Add splash screen image\n return AndroidConfig.Styles.assignStylesValue(styles, {\n add: true,\n value: '@drawable/splashscreen',\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,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,wBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,uBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,MAAMI,kBAAkB,GAAG;EACzBC,IAAI,EAAE,wBAAwB;EAC9BC,MAAM,EAAE;AACV,CAAC;AAED,MAAMC,iBAAiB,GAAG,yBAAyB;AAE5C,MAAMC,uBAA0D,GAAGA,CAACC,MAAM,EAAEC,KAAK,KAAK;EAC3FD,MAAM,GAAG,IAAAE,kCAAiB,EAACF,MAAM,EAAGA,MAAM,IAAK;IAC7C,MAAMG,eAAe,GAAGC,wBAAwB,CAACJ,MAAM,EAAEC,KAAK,CAAC;IAC/D,IAAI,CAACE,eAAe,EAAE;MACpB,OAAOH,MAAM;IACf;IACAA,MAAM,CAACK,UAAU,GAAGC,uBA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,CAAC,CAAC;AACJ;AAEO,SAASW,uBAAuBA,CACrCyB,MAA2C,EAC3C5B,eAA8B,EACO;EACrC,OAAO6B,iBAAM,CAACC,gBAAgB,CAACF,MAAM,EAAE;IAAED,KAAK,EAAE3B,eAAe;IAAEP,IAAI,EAAEE;EAAkB,CAAC,CAAC;AAC7F","ignoreList":[]}
@@ -48,31 +48,29 @@ function _AssetContents() {
48
48
  return data;
49
49
  }
50
50
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
51
+ // @ts-ignore
52
+
51
53
  const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:ios:assets');
52
54
  const IMAGE_CACHE_NAME = 'splash-ios';
53
- const IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';
54
- const BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';
55
- const PNG_FILENAME = 'image.png';
56
- const DARK_PNG_FILENAME = 'dark_image.png';
57
- const TABLET_PNG_FILENAME = 'tablet_image.png';
58
- const DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';
55
+ const IMAGESET_PATH = 'Images.xcassets/SplashScreenLogo.imageset';
56
+ const PNG_FILENAME = 'image';
57
+ const DARK_PNG_FILENAME = 'dark_image';
58
+ const TABLET_PNG_FILENAME = 'tablet_image';
59
+ const DARK_TABLET_PNG_FILENAME = 'dark_tablet_image';
59
60
  const withIosSplashAssets = (config, splash) => {
60
61
  if (!splash) {
61
62
  return config;
62
63
  }
63
64
  return (0, _configPlugins().withDangerousMod)(config, ['ios', async config => {
64
65
  const iosNamedProjectRoot = _configPlugins().IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);
65
- await createSplashScreenBackgroundImageAsync({
66
- iosNamedProjectRoot,
67
- splash
68
- });
69
66
  await configureImageAssets({
70
67
  projectRoot: config.modRequest.projectRoot,
71
68
  iosNamedProjectRoot,
72
69
  image: splash.image,
73
70
  darkImage: splash.dark?.image,
74
71
  tabletImage: splash.tabletImage,
75
- darkTabletImage: splash.dark?.tabletImage
72
+ darkTabletImage: splash.dark?.tabletImage,
73
+ logoWidth: splash.logoWidth ?? 100
76
74
  });
77
75
  return config;
78
76
  }]);
@@ -88,7 +86,8 @@ async function configureImageAssets({
88
86
  image,
89
87
  darkImage,
90
88
  tabletImage,
91
- darkTabletImage
89
+ darkTabletImage,
90
+ logoWidth
92
91
  }) {
93
92
  const imageSetPath = _path().default.resolve(iosNamedProjectRoot, IMAGESET_PATH);
94
93
 
@@ -110,31 +109,8 @@ async function configureImageAssets({
110
109
  image,
111
110
  darkImage,
112
111
  tabletImage,
113
- darkTabletImage
114
- });
115
- }
116
- async function createPngFileAsync(color, filePath) {
117
- const pngBuffer = await (0, _imageUtils().createSquareAsync)({
118
- size: 1,
119
- color
120
- });
121
- await _fsExtra().default.writeFile(filePath, pngBuffer);
122
- }
123
- async function createBackgroundImagesAsync({
124
- iosNamedProjectRoot,
125
- color,
126
- darkColor,
127
- tabletColor,
128
- darkTabletColor
129
- }) {
130
- await generateImagesAssetsAsync({
131
- async generateImageAsset(item, fileName) {
132
- await createPngFileAsync(item, _path().default.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName));
133
- },
134
- anyItem: color,
135
- darkItem: darkColor,
136
- tabletItem: tabletColor,
137
- darkTabletItem: darkTabletColor
112
+ darkTabletImage,
113
+ logoWidth
138
114
  });
139
115
  }
140
116
  async function copyImageFiles({
@@ -143,8 +119,37 @@ async function copyImageFiles({
143
119
  image,
144
120
  darkImage,
145
121
  tabletImage,
146
- darkTabletImage
122
+ darkTabletImage,
123
+ logoWidth
147
124
  }) {
125
+ await Promise.all([{
126
+ ratio: 1,
127
+ suffix: ''
128
+ }, {
129
+ ratio: 2,
130
+ suffix: '@2x'
131
+ }, {
132
+ ratio: 3,
133
+ suffix: '@3x'
134
+ }].map(async ({
135
+ ratio,
136
+ suffix
137
+ }) => {
138
+ const filePath = _path().default.resolve(iosNamedProjectRoot, IMAGESET_PATH, `${PNG_FILENAME}${suffix}.png`);
139
+ const size = logoWidth * ratio;
140
+ const {
141
+ source
142
+ } = await (0, _imageUtils().generateImageAsync)({
143
+ projectRoot,
144
+ cacheType: IMAGE_CACHE_NAME
145
+ }, {
146
+ src: image,
147
+ width: size,
148
+ height: size,
149
+ resizeMode: 'contain'
150
+ });
151
+ return await _fsExtra().default.writeFile(filePath, source);
152
+ }));
148
153
  await generateImagesAssetsAsync({
149
154
  async generateImageAsset(item, fileName) {
150
155
  // Using this method will cache the images in `.expo` based on the properties used to generate them.
@@ -177,33 +182,6 @@ async function generateImagesAssetsAsync({
177
182
  const items = [[anyItem, PNG_FILENAME], [darkItem, DARK_PNG_FILENAME], [tabletItem, TABLET_PNG_FILENAME], [darkTabletItem, DARK_TABLET_PNG_FILENAME]].filter(([item]) => !!item);
178
183
  await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));
179
184
  }
180
- async function createSplashScreenBackgroundImageAsync({
181
- iosNamedProjectRoot,
182
- splash
183
- }) {
184
- const color = splash.backgroundColor;
185
- const darkColor = splash.dark?.backgroundColor;
186
- const tabletColor = splash.tabletBackgroundColor;
187
- const darkTabletColor = splash.dark?.tabletBackgroundColor;
188
- const imagesetPath = _path().default.join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);
189
- // Ensure the Images.xcassets/... path exists
190
- await _fsExtra().default.remove(imagesetPath);
191
- await _fsExtra().default.ensureDir(imagesetPath);
192
- await createBackgroundImagesAsync({
193
- iosNamedProjectRoot,
194
- color,
195
- darkColor: darkColor ? darkColor : null,
196
- tabletColor: tabletColor ? tabletColor : null,
197
- darkTabletColor: darkTabletColor ? darkTabletColor : null
198
- });
199
- await writeContentsJsonFileAsync({
200
- assetPath: _path().default.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH),
201
- image: PNG_FILENAME,
202
- darkImage: darkColor ? DARK_PNG_FILENAME : null,
203
- tabletImage: tabletColor ? TABLET_PNG_FILENAME : null,
204
- darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null
205
- });
206
- }
207
185
  const darkAppearances = [{
208
186
  appearance: 'luminosity',
209
187
  value: 'dark'
@@ -218,20 +196,21 @@ function buildContentsJsonImages({
218
196
  // Phone light
219
197
  (0, _AssetContents().createContentsJsonItem)({
220
198
  idiom: 'universal',
221
- filename: image,
199
+ filename: `${image}.png`,
222
200
  scale: '1x'
223
201
  }), (0, _AssetContents().createContentsJsonItem)({
224
202
  idiom: 'universal',
203
+ filename: `${image}@2x.png`,
225
204
  scale: '2x'
226
205
  }), (0, _AssetContents().createContentsJsonItem)({
227
206
  idiom: 'universal',
207
+ filename: `${image}@3x.png`,
228
208
  scale: '3x'
229
209
  }),
230
210
  // Phone dark
231
211
  darkImage && (0, _AssetContents().createContentsJsonItem)({
232
212
  idiom: 'universal',
233
213
  appearances: darkAppearances,
234
- filename: darkImage,
235
214
  scale: '1x'
236
215
  }), darkImage && (0, _AssetContents().createContentsJsonItem)({
237
216
  idiom: 'universal',
@@ -1 +1 @@
1
- {"version":3,"file":"withIosSplashAssets.js","names":["_configPlugins","data","require","_imageUtils","_debug","_interopRequireDefault","_fsExtra","_path","_AssetContents","e","__esModule","default","debug","Debug","IMAGE_CACHE_NAME","IMAGESET_PATH","BACKGROUND_IMAGESET_PATH","PNG_FILENAME","DARK_PNG_FILENAME","TABLET_PNG_FILENAME","DARK_TABLET_PNG_FILENAME","withIosSplashAssets","config","splash","withDangerousMod","iosNamedProjectRoot","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","createSplashScreenBackgroundImageAsync","configureImageAssets","image","darkImage","dark","tabletImage","darkTabletImage","exports","imageSetPath","path","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","createPngFileAsync","color","filePath","pngBuffer","createSquareAsync","size","writeFile","createBackgroundImagesAsync","darkColor","tabletColor","darkTabletColor","generateImagesAssetsAsync","generateImageAsset","item","fileName","anyItem","darkItem","tabletItem","darkTabletItem","source","generateImageAsync","cacheType","src","items","filter","Promise","all","map","backgroundColor","tabletBackgroundColor","imagesetPath","join","ensureDir","darkAppearances","appearance","value","buildContentsJsonImages","createContentsJsonItem","idiom","filename","scale","appearances","undefined","Boolean","images","writeContentsJsonAsync"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashAssets.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';\nimport { createSquareAsync, generateImageAsync } from '@expo/image-utils';\nimport Debug from 'debug';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport { IOSSplashConfig } from './getIosSplashConfig';\nimport {\n ContentsJsonImage,\n ContentsJsonImageAppearance,\n createContentsJsonItem,\n writeContentsJsonAsync,\n} from '../../icons/AssetContents';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:assets');\n\nconst IMAGE_CACHE_NAME = 'splash-ios';\nconst IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';\nconst BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';\nconst PNG_FILENAME = 'image.png';\nconst DARK_PNG_FILENAME = 'dark_image.png';\nconst TABLET_PNG_FILENAME = 'tablet_image.png';\nconst DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';\n\nexport const withIosSplashAssets: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n if (!splash) {\n return config;\n }\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const iosNamedProjectRoot = IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);\n\n await createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n });\n\n await configureImageAssets({\n projectRoot: config.modRequest.projectRoot,\n iosNamedProjectRoot,\n image: splash.image,\n darkImage: splash.dark?.image,\n tabletImage: splash.tabletImage,\n darkTabletImage: splash.dark?.tabletImage,\n });\n\n return config;\n },\n ]);\n};\n\n/**\n * Creates imageset containing image for Splash/Launch Screen.\n */\nasync function configureImageAssets({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage: string | null;\n darkTabletImage?: string | null;\n}) {\n const imageSetPath = path.resolve(iosNamedProjectRoot, IMAGESET_PATH);\n\n // ensure old SplashScreen imageSet is removed\n await fs.remove(imageSetPath);\n\n if (!image) {\n return;\n }\n\n await writeContentsJsonFileAsync({\n assetPath: imageSetPath,\n image: PNG_FILENAME,\n darkImage: darkImage ? DARK_PNG_FILENAME : null,\n tabletImage: tabletImage ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null,\n });\n\n await copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n });\n}\n\nasync function createPngFileAsync(color: string, filePath: string): Promise<void> {\n const pngBuffer = await createSquareAsync({ size: 1, color });\n await fs.writeFile(filePath, pngBuffer);\n}\n\nasync function createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor,\n tabletColor,\n darkTabletColor,\n}: {\n iosNamedProjectRoot: string;\n color: string;\n darkColor: string | null;\n tabletColor: string | null;\n darkTabletColor: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n await createPngFileAsync(\n item,\n path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName)\n );\n },\n anyItem: color,\n darkItem: darkColor,\n tabletItem: tabletColor,\n darkTabletItem: darkTabletColor,\n });\n}\n\nasync function copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\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: item,\n } as any);\n // Write image buffer to the file system.\n // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(path.resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);\n },\n anyItem: image,\n darkItem: darkImage,\n tabletItem: tabletImage,\n darkTabletItem: darkTabletImage,\n });\n}\n\nasync function generateImagesAssetsAsync({\n generateImageAsset,\n anyItem,\n darkItem,\n tabletItem,\n darkTabletItem,\n}: {\n generateImageAsset: (item: string, fileName: string) => Promise<void>;\n anyItem: string;\n darkItem?: string | null;\n tabletItem?: string | null;\n darkTabletItem?: string | null;\n}) {\n const items = [\n [anyItem, PNG_FILENAME],\n [darkItem, DARK_PNG_FILENAME],\n [tabletItem, TABLET_PNG_FILENAME],\n [darkTabletItem, DARK_TABLET_PNG_FILENAME],\n ].filter(([item]) => !!item) as unknown as [string, string];\n\n await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));\n}\n\nasync function createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n}: {\n // Something like projectRoot/ios/MyApp/\n iosNamedProjectRoot: string;\n splash: IOSSplashConfig;\n}) {\n const color = splash.backgroundColor;\n const darkColor = splash.dark?.backgroundColor;\n const tabletColor = splash.tabletBackgroundColor;\n const darkTabletColor = splash.dark?.tabletBackgroundColor;\n\n const imagesetPath = path.join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);\n // Ensure the Images.xcassets/... path exists\n await fs.remove(imagesetPath);\n await fs.ensureDir(imagesetPath);\n\n await createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor: darkColor ? darkColor : null,\n tabletColor: tabletColor ? tabletColor : null,\n darkTabletColor: darkTabletColor ? darkTabletColor : null,\n });\n\n await writeContentsJsonFileAsync({\n assetPath: path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH),\n image: PNG_FILENAME,\n darkImage: darkColor ? DARK_PNG_FILENAME : null,\n tabletImage: tabletColor ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null,\n });\n}\n\nconst darkAppearances: ContentsJsonImageAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonImageAppearance,\n];\n\nexport function buildContentsJsonImages({\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n image: string;\n tabletImage: string | null;\n darkImage: string | null;\n darkTabletImage: string | null;\n}): ContentsJsonImage[] {\n return [\n // Phone light\n createContentsJsonItem({\n idiom: 'universal',\n filename: image,\n scale: '1x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '2x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '3x',\n }),\n // Phone dark\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n filename: darkImage,\n scale: '1x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: tabletImage,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: darkTabletImage ?? undefined,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n scale: '2x',\n }),\n ].filter(Boolean) as ContentsJsonImage[];\n}\n\nasync function writeContentsJsonFileAsync({\n assetPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n assetPath: string;\n image: string;\n darkImage: string | null;\n tabletImage: string | null;\n darkTabletImage: string | null;\n}) {\n const images = buildContentsJsonImages({ image, darkImage, tabletImage, darkTabletImage });\n\n debug(`create contents.json:`, assetPath);\n debug(`use images:`, images);\n await writeContentsJsonAsync(assetPath, { images });\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAK,KAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAO,eAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,cAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKmC,SAAAI,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnC,MAAMG,KAAK,GAAG,IAAAC,gBAAK,EAAC,oDAAoD,CAAC;AAEzE,MAAMC,gBAAgB,GAAG,YAAY;AACrC,MAAMC,aAAa,GAAG,uCAAuC;AAC7D,MAAMC,wBAAwB,GAAG,iDAAiD;AAClF,MAAMC,YA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AAEC,SAAS;IAAEE,WAAW;IAAEC;EAAgB,CAAC,CAAC;EAE1FzB,KAAK,CAAC,uBAAuB,EAAEiC,SAAS,CAAC;EACzCjC,KAAK,CAAC,aAAa,EAAE+E,MAAM,CAAC;EAC5B,MAAM,IAAAC,uCAAsB,EAAC/C,SAAS,EAAE;IAAE8C;EAAO,CAAC,CAAC;AACrD","ignoreList":[]}
1
+ {"version":3,"file":"withIosSplashAssets.js","names":["_configPlugins","data","require","_imageUtils","_debug","_interopRequireDefault","_fsExtra","_path","_AssetContents","e","__esModule","default","debug","Debug","IMAGE_CACHE_NAME","IMAGESET_PATH","PNG_FILENAME","DARK_PNG_FILENAME","TABLET_PNG_FILENAME","DARK_TABLET_PNG_FILENAME","withIosSplashAssets","config","splash","withDangerousMod","iosNamedProjectRoot","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","configureImageAssets","image","darkImage","dark","tabletImage","darkTabletImage","logoWidth","exports","imageSetPath","path","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","Promise","all","ratio","suffix","map","filePath","size","source","generateImageAsync","cacheType","src","width","height","resizeMode","writeFile","generateImagesAssetsAsync","generateImageAsset","item","fileName","anyItem","darkItem","tabletItem","darkTabletItem","items","filter","darkAppearances","appearance","value","buildContentsJsonImages","createContentsJsonItem","idiom","filename","scale","appearances","undefined","Boolean","images","writeContentsJsonAsync"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashAssets.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';\nimport { generateImageAsync } from '@expo/image-utils';\nimport Debug from 'debug';\nimport fs from 'fs-extra';\n// @ts-ignore\nimport path from 'path';\n\nimport { IOSSplashConfig } from './getIosSplashConfig';\nimport {\n ContentsJsonImage,\n ContentsJsonImageAppearance,\n createContentsJsonItem,\n writeContentsJsonAsync,\n} from '../../icons/AssetContents';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:assets');\n\nconst IMAGE_CACHE_NAME = 'splash-ios';\nconst IMAGESET_PATH = 'Images.xcassets/SplashScreenLogo.imageset';\nconst PNG_FILENAME = 'image';\nconst DARK_PNG_FILENAME = 'dark_image';\nconst TABLET_PNG_FILENAME = 'tablet_image';\nconst DARK_TABLET_PNG_FILENAME = 'dark_tablet_image';\n\nexport const withIosSplashAssets: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n if (!splash) {\n return config;\n }\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const iosNamedProjectRoot = IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);\n\n await configureImageAssets({\n projectRoot: config.modRequest.projectRoot,\n iosNamedProjectRoot,\n image: splash.image,\n darkImage: splash.dark?.image,\n tabletImage: splash.tabletImage,\n darkTabletImage: splash.dark?.tabletImage,\n logoWidth: splash.logoWidth ?? 100,\n });\n\n return config;\n },\n ]);\n};\n\n/**\n * Creates imageset containing image for Splash/Launch Screen.\n */\nasync function configureImageAssets({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n logoWidth,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage: string | null;\n darkTabletImage?: string | null;\n logoWidth: number;\n}) {\n const imageSetPath = path.resolve(iosNamedProjectRoot, IMAGESET_PATH);\n\n // ensure old SplashScreen imageSet is removed\n await fs.remove(imageSetPath);\n\n if (!image) {\n return;\n }\n\n await writeContentsJsonFileAsync({\n assetPath: imageSetPath,\n image: PNG_FILENAME,\n darkImage: darkImage ? DARK_PNG_FILENAME : null,\n tabletImage: tabletImage ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null,\n });\n\n await copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n logoWidth,\n });\n}\n\nasync function copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n logoWidth,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n logoWidth: number;\n}) {\n await Promise.all(\n [\n { ratio: 1, suffix: '' },\n { ratio: 2, suffix: '@2x' },\n { ratio: 3, suffix: '@3x' },\n ].map(async ({ ratio, suffix }) => {\n const filePath = path.resolve(\n iosNamedProjectRoot,\n IMAGESET_PATH,\n `${PNG_FILENAME}${suffix}.png`\n );\n\n const size = logoWidth * ratio;\n\n const { source } = await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME },\n {\n src: image,\n width: size,\n height: size,\n resizeMode: 'contain',\n }\n );\n return await fs.writeFile(filePath, source);\n })\n );\n\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\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: item,\n } as any);\n // Write image buffer to the file system.\n // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(path.resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);\n },\n anyItem: image,\n darkItem: darkImage,\n tabletItem: tabletImage,\n darkTabletItem: darkTabletImage,\n });\n}\n\nasync function generateImagesAssetsAsync({\n generateImageAsset,\n anyItem,\n darkItem,\n tabletItem,\n darkTabletItem,\n}: {\n generateImageAsset: (item: string, fileName: string) => Promise<void>;\n anyItem: string;\n darkItem?: string | null;\n tabletItem?: string | null;\n darkTabletItem?: string | null;\n}) {\n const items = [\n [anyItem, PNG_FILENAME],\n [darkItem, DARK_PNG_FILENAME],\n [tabletItem, TABLET_PNG_FILENAME],\n [darkTabletItem, DARK_TABLET_PNG_FILENAME],\n ].filter(([item]) => !!item) as unknown as [string, string];\n\n await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));\n}\n\nconst darkAppearances: ContentsJsonImageAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonImageAppearance,\n];\n\nexport function buildContentsJsonImages({\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n image: string;\n tabletImage: string | null;\n darkImage: string | null;\n darkTabletImage: string | null;\n}): ContentsJsonImage[] {\n return [\n // Phone light\n createContentsJsonItem({\n idiom: 'universal',\n filename: `${image}.png`,\n scale: '1x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n filename: `${image}@2x.png`,\n scale: '2x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n filename: `${image}@3x.png`,\n scale: '3x',\n }),\n // Phone dark\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '1x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: tabletImage,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: darkTabletImage ?? undefined,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n scale: '2x',\n }),\n ].filter(Boolean) as ContentsJsonImage[];\n}\n\nasync function writeContentsJsonFileAsync({\n assetPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n assetPath: string;\n image: string;\n darkImage: string | null;\n tabletImage: string | null;\n darkTabletImage: string | null;\n}) {\n const images = buildContentsJsonImages({ image, darkImage, tabletImage, darkTabletImage });\n\n debug(`create contents.json:`, assetPath);\n debug(`use images:`, images);\n await writeContentsJson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IACbG,WAAW,EAAER,eAAe;IAC5BO,KAAK,EAAE;EACT,CAAC,CAAC,CACL,CAACR,MAAM,CAACW,OAAO,CAAC;AACnB;AAEA,eAAetC,0BAA0BA,CAAC;EACxCC,SAAS;EACTb,KAAK;EACLC,SAAS;EACTE,WAAW;EACXC;AAOF,CAAC,EAAE;EACD,MAAM+C,MAAM,GAAGR,uBAAuB,CAAC;IAAE3C,KAAK;IAAEC,SAAS;IAAEE,WAAW;IAAEC;EAAgB,CAAC,CAAC;EAE1FvB,KAAK,CAAC,uBAAuB,EAAEgC,SAAS,CAAC;EACzChC,KAAK,CAAC,aAAa,EAAEsE,MAAM,CAAC;EAC5B,MAAM,IAAAC,uCAAsB,EAACvC,SAAS,EAAE;IAAEsC;EAAO,CAAC,CAAC;AACrD","ignoreList":[]}
@@ -46,16 +46,16 @@ function _withIosSplashScreenStoryboard() {
46
46
  };
47
47
  return data;
48
48
  }
49
- function _withIosSplashXcodeProject() {
50
- const data = require("./withIosSplashXcodeProject");
51
- _withIosSplashXcodeProject = function () {
49
+ function _withIosSplashScreenStoryboardImage() {
50
+ const data = require("./withIosSplashScreenStoryboardImage");
51
+ _withIosSplashScreenStoryboardImage = function () {
52
52
  return data;
53
53
  };
54
54
  return data;
55
55
  }
56
- function _wtihIosSplashScreenStoryboardImage() {
57
- const data = require("./wtihIosSplashScreenStoryboardImage");
58
- _wtihIosSplashScreenStoryboardImage = function () {
56
+ function _withIosSplashXcodeProject() {
57
+ const data = require("./withIosSplashXcodeProject");
58
+ _withIosSplashXcodeProject = function () {
59
59
  return data;
60
60
  };
61
61
  return data;
@@ -67,12 +67,15 @@ const withIosSplashScreen = (config, splash) => {
67
67
  if (!splash) {
68
68
  splash = (0, _getIosSplashConfig().getIosSplashConfig)(config);
69
69
  } else {
70
- debug(`custom splash config provided`);
70
+ splash = {
71
+ ...(0, _getIosSplashConfig().getIosSplashConfig)(config),
72
+ ...splash
73
+ };
71
74
  }
72
75
  debug(`config:`, splash);
73
76
  return (0, _configPlugins().withPlugins)(config, [[_withIosSplashInfoPlist().withIosSplashInfoPlist, splash], [_withIosSplashAssets().withIosSplashAssets, splash],
74
77
  // Add the image settings to the storyboard.
75
- [_wtihIosSplashScreenStoryboardImage().withIosSplashScreenImage, splash],
78
+ [_withIosSplashScreenStoryboardImage().withIosSplashScreenImage, splash],
76
79
  // Link storyboard to xcode project.
77
80
  // TODO: Maybe fold this into the base mod.
78
81
  _withIosSplashXcodeProject().withIosSplashXcodeProject,
@@ -1 +1 @@
1
- {"version":3,"file":"withIosSplashScreen.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","_getIosSplashConfig","_withIosSplashAssets","_withIosSplashInfoPlist","_withIosSplashScreenStoryboard","_withIosSplashXcodeProject","_wtihIosSplashScreenStoryboardImage","e","__esModule","default","debug","Debug","withIosSplashScreen","config","splash","getIosSplashConfig","withPlugins","withIosSplashInfoPlist","withIosSplashAssets","withIosSplashScreenImage","withIosSplashXcodeProject","withIosSplashScreenStoryboardBaseMod","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\nimport Debug from 'debug';\n\nimport { getIosSplashConfig, IOSSplashConfig } from './getIosSplashConfig';\nimport { withIosSplashAssets } from './withIosSplashAssets';\nimport { withIosSplashInfoPlist } from './withIosSplashInfoPlist';\nimport { withIosSplashScreenStoryboardBaseMod } from './withIosSplashScreenStoryboard';\nimport { withIosSplashXcodeProject } from './withIosSplashXcodeProject';\nimport { withIosSplashScreenImage } from './wtihIosSplashScreenStoryboardImage';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios');\n\nexport const withIosSplashScreen: ConfigPlugin<IOSSplashConfig | undefined | null | void> = (\n config,\n splash\n) => {\n // If the user didn't specify a splash object, infer the splash object from the Expo config.\n if (!splash) {\n splash = getIosSplashConfig(config);\n } else {\n debug(`custom splash config provided`);\n }\n\n debug(`config:`, splash);\n\n return withPlugins(config, [\n [withIosSplashInfoPlist, splash],\n [withIosSplashAssets, splash],\n // Add the image settings to the storyboard.\n [withIosSplashScreenImage, splash],\n // Link storyboard to xcode project.\n // TODO: Maybe fold this into the base mod.\n withIosSplashXcodeProject,\n // Insert the base mod last, no other ios.splashScreenStoryboard mods can be added after this.\n withIosSplashScreenStoryboardBaseMod,\n ]);\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,oBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,mBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,qBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,oBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,wBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,uBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,+BAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,8BAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,2BAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,0BAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,oCAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,mCAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgF,SAAAG,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhF,MAAMG,KAAK,GAAG,IAAAC,gBAAK,EAAC,6CAA6C,CAAC;AAE3D,MAAMC,mBAA4E,GAAGA,CAC1FC,MAAM,EACNC,MAAM,KACH;EACH;EACA,IAAI,CAACA,MAAM,EAAE;IACXA,MAAM,GAAG,IAAAC,wCAAkB,EAACF,MAAM,CAAC;EACrC,CAAC,MAAM;IACLH,KAAK,CAAC,+BAA+B,CAAC;EACxC;EAEAA,KAAK,CAAC,SAAS,EAAEI,MAAM,CAAC;EAExB,OAAO,IAAAE,4BAAW,EAACH,MAAM,EAAE,CACzB,CAACI,gDAAsB,EAAEH,MAAM,CAAC,EAChC,CAACI,0CAAmB,EAAEJ,MAAM,CAAC;EAC7B;EACA,CAACK,8DAAwB,EAAEL,MAAM,CAAC;EAClC;EACA;EACAM,sDAAyB;EACzB;EACAC,qEAAoC,CACrC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAV,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"file":"withIosSplashScreen.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","_getIosSplashConfig","_withIosSplashAssets","_withIosSplashInfoPlist","_withIosSplashScreenStoryboard","_withIosSplashScreenStoryboardImage","_withIosSplashXcodeProject","e","__esModule","default","debug","Debug","withIosSplashScreen","config","splash","getIosSplashConfig","withPlugins","withIosSplashInfoPlist","withIosSplashAssets","withIosSplashScreenImage","withIosSplashXcodeProject","withIosSplashScreenStoryboardBaseMod","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\nimport Debug from 'debug';\n\nimport { getIosSplashConfig, IOSSplashConfig } from './getIosSplashConfig';\nimport { withIosSplashAssets } from './withIosSplashAssets';\nimport { withIosSplashInfoPlist } from './withIosSplashInfoPlist';\nimport { withIosSplashScreenStoryboardBaseMod } from './withIosSplashScreenStoryboard';\nimport { withIosSplashScreenImage } from './withIosSplashScreenStoryboardImage';\nimport { withIosSplashXcodeProject } from './withIosSplashXcodeProject';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios');\n\nexport const withIosSplashScreen: ConfigPlugin<IOSSplashConfig | undefined | null | void> = (\n config,\n splash\n) => {\n // If the user didn't specify a splash object, infer the splash object from the Expo config.\n if (!splash) {\n splash = getIosSplashConfig(config);\n } else {\n splash = { ...getIosSplashConfig(config), ...splash };\n }\n\n debug(`config:`, splash);\n\n return withPlugins(config, [\n [withIosSplashInfoPlist, splash],\n [withIosSplashAssets, splash],\n // Add the image settings to the storyboard.\n [withIosSplashScreenImage, splash],\n // Link storyboard to xcode project.\n // TODO: Maybe fold this into the base mod.\n withIosSplashXcodeProject,\n // Insert the base mod last, no other ios.splashScreenStoryboard mods can be added after this.\n withIosSplashScreenStoryboardBaseMod,\n ]);\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,oBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,mBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,qBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,oBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,O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ACrC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAV,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -112,76 +112,43 @@ const withIosSplashScreenStoryboardBaseMod = config => {
112
112
  exports.withIosSplashScreenStoryboardBaseMod = withIosSplashScreenStoryboardBaseMod;
113
113
  async function getTemplateAsync() {
114
114
  const contents = `<?xml version="1.0" encoding="UTF-8"?>
115
- <document
116
- type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
117
- version="3.0"
118
- toolsVersion="16096"
119
- targetRuntime="iOS.CocoaTouch"
120
- propertyAccessControl="none"
121
- useAutolayout="YES"
122
- launchScreen="YES"
123
- useTraitCollections="YES"
124
- useSafeAreas="YES"
125
- colorMatched="YES"
126
- initialViewController="EXPO-VIEWCONTROLLER-1"
127
- >
115
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EXPO-VIEWCONTROLLER-1">
116
+ <device id="retina6_12" orientation="portrait" appearance="light"/>
128
117
  <dependencies>
129
- <deployment identifier="iOS"/>
130
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
131
- <capability name="Safe area layout guides" minToolsVersion="9.0"/>
132
- <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
118
+ <deployment identifier="iOS"/>
119
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
120
+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
121
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
133
122
  </dependencies>
134
123
  <scenes>
135
- <scene sceneID="EXPO-SCENE-1">
136
- <objects>
137
- <viewController
138
- storyboardIdentifier="SplashScreenViewController"
139
- id="EXPO-VIEWCONTROLLER-1"
140
- sceneMemberID="viewController"
141
- >
142
- <view
143
- key="view"
144
- userInteractionEnabled="NO"
145
- contentMode="scaleToFill"
146
- insetsLayoutMarginsFromSafeArea="NO"
147
- id="EXPO-ContainerView"
148
- userLabel="ContainerView"
149
- >
150
- <rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
151
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
152
- <subviews>
153
- <imageView
154
- userInteractionEnabled="NO"
155
- contentMode="scaleAspectFill"
156
- horizontalHuggingPriority="251"
157
- verticalHuggingPriority="251"
158
- insetsLayoutMarginsFromSafeArea="NO"
159
- image="SplashScreenBackground"
160
- translatesAutoresizingMaskIntoConstraints="NO"
161
- id="EXPO-SplashScreenBackground"
162
- userLabel="SplashScreenBackground"
163
- >
164
- <rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
165
- </imageView>
166
- </subviews>
167
- <color key="backgroundColor" systemColor="systemBackgroundColor"/>
168
- <constraints>
169
- <constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="top" secondItem="EXPO-ContainerView" secondAttribute="top" id="1gX-mQ-vu6"/>
170
- <constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="leading" secondItem="EXPO-ContainerView" secondAttribute="leading" id="6tX-OG-Sck"/>
171
- <constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="trailing" secondItem="EXPO-ContainerView" secondAttribute="trailing" id="ABX-8g-7v4"/>
172
- <constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="bottom" secondItem="EXPO-ContainerView" secondAttribute="bottom" id="jkI-2V-eW5"/>
173
- </constraints>
174
- <viewLayoutGuide key="safeArea" id="EXPO-SafeArea"/>
175
- </view>
176
- </viewController>
177
- <placeholder placeholderIdentifier="IBFirstResponder" id="EXPO-PLACEHOLDER-1" userLabel="First Responder" sceneMemberID="firstResponder"/>
178
- </objects>
179
- </scene>
124
+ <!--View Controller-->
125
+ <scene sceneID="EXPO-SCENE-1">
126
+ <objects>
127
+ <viewController storyboardIdentifier="SplashScreenViewController" id="EXPO-VIEWCONTROLLER-1" sceneMemberID="viewController">
128
+ <view key="view" userInteractionEnabled="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="EXPO-ContainerView" userLabel="ContainerView">
129
+ <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
130
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
131
+ <subviews>
132
+ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="SplashScreen" translatesAutoresizingMaskIntoConstraints="NO" id="EXPO-SplashScreen" userLabel="SplashScreen">
133
+ <rect key="frame" x="146.66666666666666" y="381" width="100" height="90.333333333333314"/>
134
+ </imageView>
135
+ </subviews>
136
+ <viewLayoutGuide key="safeArea" id="Rmq-lb-GrQ"/>
137
+ <constraints>
138
+ <constraint firstItem="EXPO-SplashScreen" firstAttribute="centerY" secondItem="EXPO-ContainerView" secondAttribute="centerY" id="0VC-Wk-OaO"/>
139
+ <constraint firstItem="EXPO-SplashScreen" firstAttribute="centerX" secondItem="EXPO-ContainerView" secondAttribute="centerX" id="zR4-NK-mVN"/>
140
+ </constraints>
141
+ </view>
142
+ </viewController>
143
+ <placeholder placeholderIdentifier="IBFirstResponder" id="EXPO-PLACEHOLDER-1" userLabel="First Responder" sceneMemberID="firstResponder"/>
144
+ </objects>
145
+ <point key="canvasLocation" x="140.625" y="129.4921875"/>
146
+ </scene>
180
147
  </scenes>
181
148
  <resources>
182
- <image name="SplashScreenBackground" width="1" height="1"/>
149
+ <image name="SplashScreenLogo" width="100" height="90.333335876464844"/>
183
150
  </resources>
184
- </document>`;
151
+ </document>`;
185
152
  return await new (_xml2js().Parser)().parseStringPromise(contents);
186
153
  }
187
154
  //# sourceMappingURL=withIosSplashScreenStoryboard.js.map