@expo/prebuild-config 8.0.21 → 8.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/plugins/icons/AssetContents.d.ts +1 -1
- package/build/plugins/icons/AssetContents.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.d.ts +1 -0
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js +5 -0
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js +21 -8
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js +8 -3
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js +7 -0
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashColors.js +5 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashColors.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type ContentsJsonImageIdiom = 'iphone' | 'ipad' | 'watchos' | 'ios' | 'ios-marketing' | 'universal';
|
|
2
|
-
export type ContentsJsonImageAppearanceLuminosityType = 'dark' | 'tinted';
|
|
2
|
+
export type ContentsJsonImageAppearanceLuminosityType = 'light' | 'dark' | 'tinted';
|
|
3
3
|
export type ContentsJsonAppearance = {
|
|
4
4
|
appearance: 'luminosity';
|
|
5
5
|
value: ContentsJsonImageAppearanceLuminosityType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetContents.js","names":["_fsExtra","data","_interopRequireDefault","require","_path","e","__esModule","default","createContentsJsonItem","item","writeContentsJsonAsync","directory","images","fs","ensureDir","writeFile","join","JSON","stringify","info","version","author"],"sources":["../../../src/plugins/icons/AssetContents.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { join } from 'path';\n\nexport type ContentsJsonImageIdiom =\n | 'iphone'\n | 'ipad'\n | 'watchos'\n | 'ios'\n | 'ios-marketing'\n | 'universal';\n\nexport type ContentsJsonImageAppearanceLuminosityType = 'dark' | 'tinted';\n\nexport type ContentsJsonAppearance = {\n appearance: 'luminosity';\n value: ContentsJsonImageAppearanceLuminosityType;\n};\n\nexport type ContentsJsonImageScale = '1x' | '2x' | '3x';\n\nexport interface ContentsJsonImage {\n appearances?: ContentsJsonAppearance[];\n idiom: ContentsJsonImageIdiom;\n size?: string;\n scale?: ContentsJsonImageScale;\n filename?: string;\n platform?: ContentsJsonImageIdiom;\n}\n\nexport interface ContentsJsonColor {\n appearances?: ContentsJsonAppearance[];\n idiom: ContentsJsonImageIdiom;\n color: {\n 'color-space': 'srgb';\n components: {\n alpha: string;\n blue: string;\n green: string;\n red: string;\n };\n };\n}\n\nexport interface ContentsJson {\n images: ContentsJsonImage[];\n colors: ContentsJsonColor[];\n info: {\n version: number;\n author: string;\n };\n}\n\nexport function createContentsJsonItem(item: ContentsJsonImage): ContentsJsonImage {\n return item;\n}\n\n/**\n * Writes the Config.json which is used to assign images to their respective platform, dpi, and idiom.\n *\n * @param directory path to add the Contents.json to.\n * @param contents image json data\n */\nexport async function writeContentsJsonAsync(\n directory: string,\n { images }: Pick<ContentsJson, 'images'>\n): Promise<void> {\n await fs.ensureDir(directory);\n\n await fs.writeFile(\n join(directory, 'Contents.json'),\n JSON.stringify(\n {\n images,\n info: {\n version: 1,\n // common practice is for the tool that generated the icons to be the \"author\"\n author: 'expo',\n },\n },\n null,\n 2\n )\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAmDrB,SAASG,sBAAsBA,CAACC,IAAuB,EAAqB;EACjF,OAAOA,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,sBAAsBA,CAC1CC,SAAiB,EACjB;EAAEC;AAAqC,CAAC,EACzB;EACf,MAAMC,kBAAE,CAACC,SAAS,CAACH,SAAS,CAAC;EAE7B,MAAME,kBAAE,CAACE,SAAS,CAChB,IAAAC,YAAI,EAACL,SAAS,EAAE,eAAe,CAAC,EAChCM,IAAI,CAACC,SAAS,CACZ;IACEN,MAAM;IACNO,IAAI,EAAE;MACJC,OAAO,EAAE,CAAC;MACV;MACAC,MAAM,EAAE;IACV;EACF,CAAC,EACD,IAAI,EACJ,CACF,CACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"AssetContents.js","names":["_fsExtra","data","_interopRequireDefault","require","_path","e","__esModule","default","createContentsJsonItem","item","writeContentsJsonAsync","directory","images","fs","ensureDir","writeFile","join","JSON","stringify","info","version","author"],"sources":["../../../src/plugins/icons/AssetContents.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { join } from 'path';\n\nexport type ContentsJsonImageIdiom =\n | 'iphone'\n | 'ipad'\n | 'watchos'\n | 'ios'\n | 'ios-marketing'\n | 'universal';\n\nexport type ContentsJsonImageAppearanceLuminosityType = 'light' | 'dark' | 'tinted';\n\nexport type ContentsJsonAppearance = {\n appearance: 'luminosity';\n value: ContentsJsonImageAppearanceLuminosityType;\n};\n\nexport type ContentsJsonImageScale = '1x' | '2x' | '3x';\n\nexport interface ContentsJsonImage {\n appearances?: ContentsJsonAppearance[];\n idiom: ContentsJsonImageIdiom;\n size?: string;\n scale?: ContentsJsonImageScale;\n filename?: string;\n platform?: ContentsJsonImageIdiom;\n}\n\nexport interface ContentsJsonColor {\n appearances?: ContentsJsonAppearance[];\n idiom: ContentsJsonImageIdiom;\n color: {\n 'color-space': 'srgb';\n components: {\n alpha: string;\n blue: string;\n green: string;\n red: string;\n };\n };\n}\n\nexport interface ContentsJson {\n images: ContentsJsonImage[];\n colors: ContentsJsonColor[];\n info: {\n version: number;\n author: string;\n };\n}\n\nexport function createContentsJsonItem(item: ContentsJsonImage): ContentsJsonImage {\n return item;\n}\n\n/**\n * Writes the Config.json which is used to assign images to their respective platform, dpi, and idiom.\n *\n * @param directory path to add the Contents.json to.\n * @param contents image json data\n */\nexport async function writeContentsJsonAsync(\n directory: string,\n { images }: Pick<ContentsJson, 'images'>\n): Promise<void> {\n await fs.ensureDir(directory);\n\n await fs.writeFile(\n join(directory, 'Contents.json'),\n JSON.stringify(\n {\n images,\n info: {\n version: 1,\n // common practice is for the tool that generated the icons to be the \"author\"\n author: 'expo',\n },\n },\n null,\n 2\n )\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAmDrB,SAASG,sBAAsBA,CAACC,IAAuB,EAAqB;EACjF,OAAOA,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,sBAAsBA,CAC1CC,SAAiB,EACjB;EAAEC;AAAqC,CAAC,EACzB;EACf,MAAMC,kBAAE,CAACC,SAAS,CAACH,SAAS,CAAC;EAE7B,MAAME,kBAAE,CAACE,SAAS,CAChB,IAAAC,YAAI,EAACL,SAAS,EAAE,eAAe,CAAC,EAChCM,IAAI,CAACC,SAAS,CACZ;IACEN,MAAM;IACNO,IAAI,EAAE;MACJC,OAAO,EAAE,CAAC;MACV;MACAC,MAAM,EAAE;IACV;EACF,CAAC,EACD,IAAI,EACJ,CACF,CACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -18,6 +18,7 @@ function getAndroidSplashConfig(config, props) {
|
|
|
18
18
|
hdpi: splash.hdpi ?? splash.image,
|
|
19
19
|
mdpi: splash.mdpi ?? splash.image,
|
|
20
20
|
backgroundColor: splash.backgroundColor,
|
|
21
|
+
enableFullScreenImage_legacy: splash.enableFullScreenImage_legacy,
|
|
21
22
|
resizeMode: splash.resizeMode ?? defaultResizeMode,
|
|
22
23
|
imageWidth: splash.imageWidth ?? 100,
|
|
23
24
|
dark: splash.dark
|
|
@@ -33,6 +34,7 @@ function getAndroidSplashConfig(config, props) {
|
|
|
33
34
|
mdpi: splash.mdpi ?? splash.image,
|
|
34
35
|
backgroundColor: splash.backgroundColor,
|
|
35
36
|
image: splash.image,
|
|
37
|
+
enableFullScreenImage_legacy: true,
|
|
36
38
|
resizeMode: splash.resizeMode ?? defaultResizeMode,
|
|
37
39
|
imageWidth: 200,
|
|
38
40
|
dark: splash.dark
|
|
@@ -47,6 +49,7 @@ function getAndroidSplashConfig(config, props) {
|
|
|
47
49
|
hdpi: splash.image,
|
|
48
50
|
mdpi: splash.image,
|
|
49
51
|
backgroundColor: splash.backgroundColor,
|
|
52
|
+
enableFullScreenImage_legacy: true,
|
|
50
53
|
resizeMode: splash.resizeMode ?? defaultResizeMode,
|
|
51
54
|
imageWidth: 200,
|
|
52
55
|
dark: splash.dark
|
|
@@ -62,6 +65,7 @@ function getAndroidDarkSplashConfig(config, props) {
|
|
|
62
65
|
xxxhdpi: splash.xxxhdpi ?? splash.image,
|
|
63
66
|
xxhdpi: splash.xxhdpi ?? splash.image,
|
|
64
67
|
xhdpi: splash.xhdpi ?? splash.image,
|
|
68
|
+
enableFullScreenImage_legacy: props.enableFullScreenImage_legacy,
|
|
65
69
|
hdpi: splash.hdpi ?? splash.image,
|
|
66
70
|
mdpi: splash.mdpi ?? splash.image,
|
|
67
71
|
backgroundColor: splash.backgroundColor,
|
|
@@ -80,6 +84,7 @@ function getAndroidDarkSplashConfig(config, props) {
|
|
|
80
84
|
xhdpi: splash.xhdpi ?? splash.image,
|
|
81
85
|
hdpi: splash.hdpi ?? splash.image,
|
|
82
86
|
mdpi: splash.mdpi ?? splash.image,
|
|
87
|
+
enableFullScreenImage_legacy: true,
|
|
83
88
|
backgroundColor: splash.backgroundColor,
|
|
84
89
|
// Can't support dark resizeMode because the resize mode is hardcoded into the MainActivity.java
|
|
85
90
|
resizeMode: lightTheme?.resizeMode ?? defaultResizeMode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAndroidSplashConfig.js","names":["defaultResizeMode","getAndroidSplashConfig","config","props","splash","xxxhdpi","image","xxhdpi","xhdpi","hdpi","mdpi","backgroundColor","resizeMode","imageWidth","dark","android","getAndroidDarkSplashConfig","lightTheme"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nexport type SplashScreenConfig = {\n xxxhdpi?: string;\n xxhdpi?: string;\n xhdpi?: string;\n hdpi?: string;\n mdpi?: string;\n image?: string;\n backgroundColor?: string;\n resizeMode: 'contain' | 'cover' | 'native';\n dark?: {\n backgroundColor?: string;\n xxxhdpi?: string;\n xxhdpi?: string;\n xhdpi?: string;\n hdpi?: string;\n mdpi?: string;\n image?: string;\n resizeMode?: 'contain' | 'cover' | 'native';\n };\n};\n\nexport type AndroidSplashConfig = {\n imageWidth?: number;\n} & SplashScreenConfig;\n\nconst defaultResizeMode = 'contain';\n\nexport function getAndroidSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>,\n props?: AndroidSplashConfig | null\n): AndroidSplashConfig | null {\n // Respect the splash screen object, don't mix and match across different splash screen objects\n // in case the user wants the top level splash to apply to every platform except android.\n if (props) {\n const splash = props;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: splash.imageWidth ?? 100,\n dark: splash.dark,\n };\n }\n\n if (config.android?.splash) {\n const splash = config.android?.splash;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n image: splash.image,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: 200,\n dark: splash.dark,\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n return {\n xxxhdpi: splash.image,\n xxhdpi: splash.image,\n xhdpi: splash.image,\n hdpi: splash.image,\n mdpi: splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: 200,\n dark: splash.dark,\n };\n }\n\n return null;\n}\n\nexport function getAndroidDarkSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>,\n props?: AndroidSplashConfig | null\n): SplashScreenConfig | null {\n if (props?.dark) {\n const splash = props.dark;\n const lightTheme = getAndroidSplashConfig(config, props);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: lightTheme?.resizeMode ?? defaultResizeMode,\n };\n }\n\n // Respect the splash screen object, don't mix and match across different splash screen objects\n // in case the user wants the top level splash to apply to every platform except android.\n if (config.android?.splash?.dark) {\n const splash = config.android?.splash?.dark;\n const lightTheme = getAndroidSplashConfig(config, props);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n // Can't support dark resizeMode because the resize mode is hardcoded into the MainActivity.java\n resizeMode: lightTheme?.resizeMode ?? defaultResizeMode,\n };\n }\n\n return null;\n}\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"getAndroidSplashConfig.js","names":["defaultResizeMode","getAndroidSplashConfig","config","props","splash","xxxhdpi","image","xxhdpi","xhdpi","hdpi","mdpi","backgroundColor","enableFullScreenImage_legacy","resizeMode","imageWidth","dark","android","getAndroidDarkSplashConfig","lightTheme"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nexport type SplashScreenConfig = {\n xxxhdpi?: string;\n xxhdpi?: string;\n xhdpi?: string;\n hdpi?: string;\n mdpi?: string;\n image?: string;\n backgroundColor?: string;\n enableFullScreenImage_legacy?: boolean;\n resizeMode: 'contain' | 'cover' | 'native';\n dark?: {\n backgroundColor?: string;\n xxxhdpi?: string;\n xxhdpi?: string;\n xhdpi?: string;\n hdpi?: string;\n mdpi?: string;\n image?: string;\n resizeMode?: 'contain' | 'cover' | 'native';\n };\n};\n\nexport type AndroidSplashConfig = {\n imageWidth?: number;\n} & SplashScreenConfig;\n\nconst defaultResizeMode = 'contain';\n\nexport function getAndroidSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>,\n props?: AndroidSplashConfig | null\n): AndroidSplashConfig | null {\n // Respect the splash screen object, don't mix and match across different splash screen objects\n // in case the user wants the top level splash to apply to every platform except android.\n if (props) {\n const splash = props;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n enableFullScreenImage_legacy: splash.enableFullScreenImage_legacy,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: splash.imageWidth ?? 100,\n dark: splash.dark,\n };\n }\n\n if (config.android?.splash) {\n const splash = config.android?.splash;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n image: splash.image,\n enableFullScreenImage_legacy: true,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: 200,\n dark: splash.dark,\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n return {\n xxxhdpi: splash.image,\n xxhdpi: splash.image,\n xhdpi: splash.image,\n hdpi: splash.image,\n mdpi: splash.image,\n backgroundColor: splash.backgroundColor,\n enableFullScreenImage_legacy: true,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n imageWidth: 200,\n dark: splash.dark,\n };\n }\n\n return null;\n}\n\nexport function getAndroidDarkSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>,\n props?: AndroidSplashConfig | null\n): SplashScreenConfig | null {\n if (props?.dark) {\n const splash = props.dark;\n const lightTheme = getAndroidSplashConfig(config, props);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n enableFullScreenImage_legacy: props.enableFullScreenImage_legacy,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n backgroundColor: splash.backgroundColor,\n resizeMode: lightTheme?.resizeMode ?? defaultResizeMode,\n };\n }\n\n // Respect the splash screen object, don't mix and match across different splash screen objects\n // in case the user wants the top level splash to apply to every platform except android.\n if (config.android?.splash?.dark) {\n const splash = config.android?.splash?.dark;\n const lightTheme = getAndroidSplashConfig(config, props);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image,\n xxhdpi: splash.xxhdpi ?? splash.image,\n xhdpi: splash.xhdpi ?? splash.image,\n hdpi: splash.hdpi ?? splash.image,\n mdpi: splash.mdpi ?? splash.image,\n enableFullScreenImage_legacy: true,\n backgroundColor: splash.backgroundColor,\n // Can't support dark resizeMode because the resize mode is hardcoded into the MainActivity.java\n resizeMode: lightTheme?.resizeMode ?? defaultResizeMode,\n };\n }\n\n return null;\n}\n"],"mappings":";;;;;;;AA4BA,MAAMA,iBAAiB,GAAG,SAAS;AAE5B,SAASC,sBAAsBA,CACpCC,MAA8C,EAC9CC,KAAkC,EACN;EAC5B;EACA;EACA,IAAIA,KAAK,EAAE;IACT,MAAMC,MAAM,GAAGD,KAAK;IACpB,OAAO;MACLE,OAAO,EAAED,MAAM,CAACC,OAAO,IAAID,MAAM,CAACE,KAAK;MACvCC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAIH,MAAM,CAACE,KAAK;MACrCE,KAAK,EAAEJ,MAAM,CAACI,KAAK,IAAIJ,MAAM,CAACE,KAAK;MACnCG,IAAI,EAAEL,MAAM,CAACK,IAAI,IAAIL,MAAM,CAACE,KAAK;MACjCI,IAAI,EAAEN,MAAM,CAACM,IAAI,IAAIN,MAAM,CAACE,KAAK;MACjCK,eAAe,EAAEP,MAAM,CAACO,eAAe;MACvCC,4BAA4B,EAAER,MAAM,CAACQ,4BAA4B;MACjEC,UAAU,EAAET,MAAM,CAACS,UAAU,IAAIb,iBAAiB;MAClDc,UAAU,E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,MAAM,CAACE,KAAK;MACjCM,4BAA4B,EAAE,IAAI;MAClCD,eAAe,EAAEP,MAAM,CAACO,eAAe;MACvC;MACAE,UAAU,EAAEK,UAAU,EAAEL,UAAU,IAAIb;IACxC,CAAC;EACH;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -149,12 +149,22 @@ async function clearAllExistingSplashImagesAsync(projectRoot) {
|
|
|
149
149
|
}
|
|
150
150
|
async function setSplashImageDrawablesForThemeAsync(config, theme, projectRoot, imageWidth = 100) {
|
|
151
151
|
if (!config) return;
|
|
152
|
-
const androidMainPath = _path().default.join(projectRoot, 'android/app/src/main');
|
|
153
152
|
const sizes = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'];
|
|
154
153
|
await Promise.all(sizes.map(async imageKey => {
|
|
155
154
|
// @ts-ignore
|
|
156
155
|
const image = config[imageKey];
|
|
157
156
|
if (image) {
|
|
157
|
+
if (config.enableFullScreenImage_legacy) {
|
|
158
|
+
const {
|
|
159
|
+
source
|
|
160
|
+
} = await (0, _imageUtils().generateImageAsync)({
|
|
161
|
+
projectRoot,
|
|
162
|
+
cacheType: IMAGE_CACHE_NAME
|
|
163
|
+
}, {
|
|
164
|
+
src: image
|
|
165
|
+
});
|
|
166
|
+
return writeDrawable(projectRoot, imageKey, theme, source);
|
|
167
|
+
}
|
|
158
168
|
const multiplier = DRAWABLES_CONFIGS[imageKey].dimensionsMultiplier;
|
|
159
169
|
const size = imageWidth * multiplier; // "imageWidth" must be replaced by the logo width chosen by the user in its config file
|
|
160
170
|
const canvasSize = 288 * multiplier;
|
|
@@ -181,15 +191,18 @@ async function setSplashImageDrawablesForThemeAsync(config, theme, projectRoot,
|
|
|
181
191
|
x: (canvasSize - size) / 2,
|
|
182
192
|
y: (canvasSize - size) / 2
|
|
183
193
|
});
|
|
184
|
-
|
|
185
|
-
// Get output path for drawable.
|
|
186
|
-
const outputPath = _path().default.join(androidMainPath, DRAWABLES_CONFIGS[imageKey].modes[theme].path);
|
|
187
|
-
const folder = _path().default.dirname(outputPath);
|
|
188
|
-
// Ensure directory exists.
|
|
189
|
-
await _fsExtra().default.ensureDir(folder);
|
|
190
|
-
await _fsExtra().default.writeFile(outputPath, composedImage);
|
|
194
|
+
await writeDrawable(projectRoot, imageKey, theme, composedImage);
|
|
191
195
|
}
|
|
192
196
|
return null;
|
|
193
197
|
}));
|
|
194
198
|
}
|
|
199
|
+
async function writeDrawable(projectRoot, imageKey, theme, composedImage) {
|
|
200
|
+
const androidMainPath = _path().default.join(projectRoot, 'android/app/src/main');
|
|
201
|
+
// Get output path for drawable.
|
|
202
|
+
const outputPath = _path().default.join(androidMainPath, DRAWABLES_CONFIGS[imageKey].modes[theme].path);
|
|
203
|
+
const folder = _path().default.dirname(outputPath);
|
|
204
|
+
// Ensure directory exists.
|
|
205
|
+
await _fsExtra().default.ensureDir(folder);
|
|
206
|
+
await _fsExtra().default.writeFile(outputPath, composedImage);
|
|
207
|
+
}
|
|
195
208
|
//# sourceMappingURL=withAndroidSplashImages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashImages.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_getAndroidSplashConfig","e","__esModule","default","IMAGE_CACHE_NAME","SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","props","withDangerousMod","setSplashImageDrawablesAsync","modRequest","projectRoot","imageWidth","exports","clearAllExistingSplashImagesAsync","splash","getAndroidSplashConfig","darkSplash","getAndroidDarkSplashConfig","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","sizes","imageKey","image","multiplier","size","canvasSize","background","generateImageBackgroundAsync","width","height","backgroundColor","resizeMode","source","foreground","generateImageAsync","cacheType","src","composedImage","compositeImagesAsync","x","y","outputPath","folder","dirname","ensureDir","writeFile"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts"],"sourcesContent":["import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport {\n generateImageAsync,\n compositeImagesAsync,\n generateImageBackgroundAsync,\n} from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\n AndroidSplashConfig,\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n SplashScreenConfig,\n} from './getAndroidSplashConfig';\n\ntype DRAWABLE_SIZE = 'default' | 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype THEME = 'light' | 'dark';\n\nconst IMAGE_CACHE_NAME = 'splash-android';\nconst SPLASH_SCREEN_FILENAME = 'splashscreen_logo.png';\nconst DRAWABLES_CONFIGS: {\n [key in DRAWABLE_SIZE]: {\n modes: {\n [key in THEME]: {\n path: string;\n };\n };\n dimensionsMultiplier: number;\n };\n} = {\n default: {\n modes: {\n light: {\n path: `./res/drawable/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n mdpi: {\n modes: {\n light: {\n path: `./res/drawable-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n hdpi: {\n modes: {\n light: {\n path: `./res/drawable-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1.5,\n },\n xhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 2,\n },\n xxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 3,\n },\n xxxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 4,\n },\n};\n\nexport const withAndroidSplashImages: ConfigPlugin<AndroidSplashConfig> = (config, props) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setSplashImageDrawablesAsync(\n config,\n props,\n config.modRequest.projectRoot,\n props?.imageWidth ?? 200\n );\n return config;\n },\n ]);\n};\n\n/**\n * Deletes all previous splash_screen_images and copies new one to desired drawable directory.\n * If path isn't provided then no new image is placed in drawable directories.\n * @see https://developer.android.com/training/multiscreen/screendensities\n *\n * @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.\n */\nexport async function setSplashImageDrawablesAsync(\n config: Pick<ExpoConfig, 'android' | 'splash'>,\n props: AndroidSplashConfig | null,\n projectRoot: string,\n imageWidth: number\n) {\n await clearAllExistingSplashImagesAsync(projectRoot);\n\n const splash = getAndroidSplashConfig(config, props);\n const darkSplash = getAndroidDarkSplashConfig(config, props);\n\n await Promise.all([\n setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot, imageWidth),\n setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot, imageWidth),\n ]);\n}\n\nasync function clearAllExistingSplashImagesAsync(projectRoot: string) {\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n Object.values(DRAWABLES_CONFIGS).map(async ({ modes }) => {\n await Promise.all(\n Object.values(modes).map(async ({ path: filePath }) => {\n if (await fs.pathExists(path.resolve(androidMainPath, filePath))) {\n await fs.remove(path.resolve(androidMainPath, filePath));\n }\n })\n );\n })\n );\n}\n\nexport async function setSplashImageDrawablesForThemeAsync(\n config: SplashScreenConfig | null,\n theme: 'dark' | 'light',\n projectRoot: string,\n imageWidth: number = 100\n) {\n if (!config) return;\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n const sizes: DRAWABLE_SIZE[] = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'];\n\n await Promise.all(\n sizes.map(async (imageKey) => {\n // @ts-ignore\n const image = config[imageKey];\n\n if (image) {\n const multiplier = DRAWABLES_CONFIGS[imageKey].dimensionsMultiplier;\n const size = imageWidth * multiplier; // \"imageWidth\" must be replaced by the logo width chosen by the user in its config file\n const canvasSize = 288 * multiplier;\n\n const background = await generateImageBackgroundAsync({\n width: canvasSize,\n height: canvasSize,\n backgroundColor: config.backgroundColor ?? 'transparent',\n resizeMode: 'cover',\n });\n\n const { source: foreground } = await generateImageAsync(\n {\n projectRoot,\n cacheType: IMAGE_CACHE_NAME,\n },\n {\n src: image,\n resizeMode: 'contain',\n width: size,\n height: size,\n }\n );\n\n const composedImage = await compositeImagesAsync({\n background,\n foreground,\n x: (canvasSize - size) / 2,\n y: (canvasSize - size) / 2,\n });\n\n // Get output path for drawable.\n const outputPath = path.join(\n androidMainPath,\n DRAWABLES_CONFIGS[imageKey].modes[theme].path\n );\n\n const folder = path.dirname(outputPath);\n // Ensure directory exists.\n await fs.ensureDir(folder);\n await fs.writeFile(outputPath, composedImage);\n }\n return null;\n })\n );\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAA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D,eAAI,CAAC2D,OAAO,CAACF,UAAU,CAAC;MACvC;MACA,MAAM1B,kBAAE,CAAC6B,SAAS,CAACF,MAAM,CAAC;MAC1B,MAAM3B,kBAAE,CAAC8B,SAAS,CAACJ,UAAU,EAAEJ,aAAa,CAAC;IAC/C;IACA,OAAO,IAAI;EACb,CAAC,CACH,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"withAndroidSplashImages.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_getAndroidSplashConfig","e","__esModule","default","IMAGE_CACHE_NAME","SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","props","withDangerousMod","setSplashImageDrawablesAsync","modRequest","projectRoot","imageWidth","exports","clearAllExistingSplashImagesAsync","splash","getAndroidSplashConfig","darkSplash","getAndroidDarkSplashConfig","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","sizes","imageKey","image","enableFullScreenImage_legacy","source","generateImageAsync","cacheType","src","writeDrawable","multiplier","size","canvasSize","background","generateImageBackgroundAsync","width","height","backgroundColor","resizeMode","foreground","composedImage","compositeImagesAsync","x","y","outputPath","folder","dirname","ensureDir","writeFile"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts"],"sourcesContent":["import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport {\n generateImageAsync,\n compositeImagesAsync,\n generateImageBackgroundAsync,\n} from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\n AndroidSplashConfig,\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n SplashScreenConfig,\n} from './getAndroidSplashConfig';\n\ntype DRAWABLE_SIZE = 'default' | 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype THEME = 'light' | 'dark';\n\nconst IMAGE_CACHE_NAME = 'splash-android';\nconst SPLASH_SCREEN_FILENAME = 'splashscreen_logo.png';\nconst DRAWABLES_CONFIGS: {\n [key in DRAWABLE_SIZE]: {\n modes: {\n [key in THEME]: {\n path: string;\n };\n };\n dimensionsMultiplier: number;\n };\n} = {\n default: {\n modes: {\n light: {\n path: `./res/drawable/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n mdpi: {\n modes: {\n light: {\n path: `./res/drawable-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n hdpi: {\n modes: {\n light: {\n path: `./res/drawable-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1.5,\n },\n xhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 2,\n },\n xxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 3,\n },\n xxxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 4,\n },\n};\n\nexport const withAndroidSplashImages: ConfigPlugin<AndroidSplashConfig> = (config, props) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setSplashImageDrawablesAsync(\n config,\n props,\n config.modRequest.projectRoot,\n props?.imageWidth ?? 200\n );\n return config;\n },\n ]);\n};\n\n/**\n * Deletes all previous splash_screen_images and copies new one to desired drawable directory.\n * If path isn't provided then no new image is placed in drawable directories.\n * @see https://developer.android.com/training/multiscreen/screendensities\n *\n * @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.\n */\nexport async function setSplashImageDrawablesAsync(\n config: Pick<ExpoConfig, 'android' | 'splash'>,\n props: AndroidSplashConfig | null,\n projectRoot: string,\n imageWidth: number\n) {\n await clearAllExistingSplashImagesAsync(projectRoot);\n\n const splash = getAndroidSplashConfig(config, props);\n const darkSplash = getAndroidDarkSplashConfig(config, props);\n\n await Promise.all([\n setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot, imageWidth),\n setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot, imageWidth),\n ]);\n}\n\nasync function clearAllExistingSplashImagesAsync(projectRoot: string) {\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n Object.values(DRAWABLES_CONFIGS).map(async ({ modes }) => {\n await Promise.all(\n Object.values(modes).map(async ({ path: filePath }) => {\n if (await fs.pathExists(path.resolve(androidMainPath, filePath))) {\n await fs.remove(path.resolve(androidMainPath, filePath));\n }\n })\n );\n })\n );\n}\n\nexport async function setSplashImageDrawablesForThemeAsync(\n config: SplashScreenConfig | null,\n theme: 'dark' | 'light',\n projectRoot: string,\n imageWidth: number = 100\n) {\n if (!config) return;\n const sizes: DRAWABLE_SIZE[] = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'];\n\n await Promise.all(\n sizes.map(async (imageKey) => {\n // @ts-ignore\n const image = config[imageKey];\n\n if (image) {\n if (config.enableFullScreenImage_legacy) {\n const { source } = await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME },\n {\n src: image,\n } as any\n );\n\n return writeDrawable(projectRoot, imageKey, theme, source);\n }\n\n const multiplier = DRAWABLES_CONFIGS[imageKey].dimensionsMultiplier;\n const size = imageWidth * multiplier; // \"imageWidth\" must be replaced by the logo width chosen by the user in its config file\n const canvasSize = 288 * multiplier;\n\n const background = await generateImageBackgroundAsync({\n width: canvasSize,\n height: canvasSize,\n backgroundColor: config.backgroundColor ?? 'transparent',\n resizeMode: 'cover',\n });\n\n const { source: foreground } = await generateImageAsync(\n {\n projectRoot,\n cacheType: IMAGE_CACHE_NAME,\n },\n {\n src: image,\n resizeMode: 'contain',\n width: size,\n height: size,\n }\n );\n\n const composedImage = await compositeImagesAsync({\n background,\n foreground,\n x: (canvasSize - size) / 2,\n y: (canvasSize - size) / 2,\n });\n\n await writeDrawable(projectRoot, imageKey, theme, composedImage);\n }\n return null;\n })\n );\n}\n\nasync function writeDrawable(\n projectRoot: string,\n imageKey: DRAWABLE_SIZE,\n theme: 'dark' | 'light',\n composedImage: Buffer\n) {\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n // Get output path for drawable.\n const outputPath = path.join(androidMainPath, DRAWABLES_CONFIGS[imageKey].modes[theme].path);\n\n const folder = path.dirname(outputPath);\n // Ensure directory exists.\n await fs.ensureDir(folder);\n await fs.writeFile(outputPath, composedImage);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAA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AEA,eAAeX,aAAaA,CAC1B9B,WAAmB,EACnBuB,QAAuB,EACvBF,KAAuB,EACvBoB,aAAqB,EACrB;EACA,MAAM9B,eAAe,GAAGzB,eAAI,CAAC0B,IAAI,CAACZ,WAAW,EAAE,sBAAsB,CAAC;EACtE;EACA,MAAM6C,UAAU,GAAG3D,eAAI,CAAC0B,IAAI,CAACD,eAAe,EAAE5B,iBAAiB,CAACwC,QAAQ,CAAC,CAACvC,KAAK,CAACqC,KAAK,CAAC,CAACnC,IAAI,CAAC;EAE5F,MAAM4D,MAAM,GAAG5D,eAAI,CAAC6D,OAAO,CAACF,UAAU,CAAC;EACvC;EACA,MAAM5B,kBAAE,CAAC+B,SAAS,CAACF,MAAM,CAAC;EAC1B,MAAM7B,kBAAE,CAACgC,SAAS,CAACJ,UAAU,EAAEJ,aAAa,CAAC;AAC/C","ignoreList":[]}
|
|
@@ -57,7 +57,7 @@ const withAndroidSplashStyles = (config, {
|
|
|
57
57
|
});
|
|
58
58
|
config = (0, _configPlugins().withAndroidStyles)(config, config => {
|
|
59
59
|
config.modResults = removeOldSplashStyleGroup(config.modResults);
|
|
60
|
-
config.modResults = addSplashScreenStyle(config.modResults, isLegacyConfig);
|
|
60
|
+
config.modResults = addSplashScreenStyle(config.modResults, isLegacyConfig, splashConfig?.enableFullScreenImage_legacy ?? false);
|
|
61
61
|
return config;
|
|
62
62
|
});
|
|
63
63
|
return config;
|
|
@@ -65,7 +65,7 @@ const withAndroidSplashStyles = (config, {
|
|
|
65
65
|
|
|
66
66
|
// Add the style that extends Theme.SplashScreen
|
|
67
67
|
exports.withAndroidSplashStyles = withAndroidSplashStyles;
|
|
68
|
-
function addSplashScreenStyle(styles, isLegacyConfig) {
|
|
68
|
+
function addSplashScreenStyle(styles, isLegacyConfig, enableFullScreen) {
|
|
69
69
|
const {
|
|
70
70
|
resources
|
|
71
71
|
} = styles;
|
|
@@ -86,7 +86,12 @@ function addSplashScreenStyle(styles, isLegacyConfig) {
|
|
|
86
86
|
name: 'windowSplashScreenBackground'
|
|
87
87
|
},
|
|
88
88
|
_: '@color/splashscreen_background'
|
|
89
|
-
}, {
|
|
89
|
+
}, enableFullScreen ? {
|
|
90
|
+
$: {
|
|
91
|
+
name: 'android:windowBackground'
|
|
92
|
+
},
|
|
93
|
+
_: '@drawable/splashscreen_logo'
|
|
94
|
+
} : {
|
|
90
95
|
$: {
|
|
91
96
|
name: 'windowSplashScreenAnimatedIcon'
|
|
92
97
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashStyles.js","names":["_configPlugins","data","require","_android","_getAndroidSplashConfig","styleResourceGroup","name","parent","SPLASH_COLOR_NAME","withAndroidSplashStyles","config","splashConfig","isLegacyConfig","withAndroidColors","backgroundColor","getSplashBackgroundColor","modResults","setSplashColorsForTheme","withAndroidColorsNight","getSplashDarkBackgroundColor","withAndroidStyles","removeOldSplashStyleGroup","addSplashScreenStyle","exports","styles","resources","style","item","$","_","filter","group","head","matches","props","getAndroidSplashConfig","getAndroidDarkSplashConfig","setSplashStylesForTheme","AndroidConfig","Styles","assignStylesValue","add","value","colors","Colors","assignColorValue"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { Colors } from '@expo/config-plugins/build/android';\nimport { ExpoConfig } from '@expo/config-types';\n\nimport {\n AndroidSplashConfig,\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n} from './getAndroidSplashConfig';\n\nconst styleResourceGroup = {\n name: 'Theme.App.SplashScreen',\n parent: 'Theme.SplashScreen',\n};\n\nconst SPLASH_COLOR_NAME = 'splashscreen_background';\n\nexport const withAndroidSplashStyles: ConfigPlugin<{\n splashConfig: AndroidSplashConfig | null;\n isLegacyConfig: boolean;\n}> = (config, { splashConfig, isLegacyConfig }) => {\n config = withAndroidColors(config, (config) => {\n const backgroundColor = getSplashBackgroundColor(config, splashConfig);\n if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidColorsNight(config, (config) => {\n const backgroundColor = getSplashDarkBackgroundColor(config, splashConfig);\n if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidStyles(config, (config) => {\n config.modResults = removeOldSplashStyleGroup(config.modResults);\n config.modResults = addSplashScreenStyle(config.modResults
|
|
1
|
+
{"version":3,"file":"withAndroidSplashStyles.js","names":["_configPlugins","data","require","_android","_getAndroidSplashConfig","styleResourceGroup","name","parent","SPLASH_COLOR_NAME","withAndroidSplashStyles","config","splashConfig","isLegacyConfig","withAndroidColors","backgroundColor","getSplashBackgroundColor","modResults","setSplashColorsForTheme","withAndroidColorsNight","getSplashDarkBackgroundColor","withAndroidStyles","removeOldSplashStyleGroup","addSplashScreenStyle","enableFullScreenImage_legacy","exports","styles","enableFullScreen","resources","style","item","$","_","filter","group","head","matches","props","getAndroidSplashConfig","getAndroidDarkSplashConfig","setSplashStylesForTheme","AndroidConfig","Styles","assignStylesValue","add","value","colors","Colors","assignColorValue"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { Colors } from '@expo/config-plugins/build/android';\nimport { ExpoConfig } from '@expo/config-types';\n\nimport {\n AndroidSplashConfig,\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n} from './getAndroidSplashConfig';\n\nconst styleResourceGroup = {\n name: 'Theme.App.SplashScreen',\n parent: 'Theme.SplashScreen',\n};\n\nconst SPLASH_COLOR_NAME = 'splashscreen_background';\n\nexport const withAndroidSplashStyles: ConfigPlugin<{\n splashConfig: AndroidSplashConfig | null;\n isLegacyConfig: boolean;\n}> = (config, { splashConfig, isLegacyConfig }) => {\n config = withAndroidColors(config, (config) => {\n const backgroundColor = getSplashBackgroundColor(config, splashConfig);\n if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidColorsNight(config, (config) => {\n const backgroundColor = getSplashDarkBackgroundColor(config, splashConfig);\n if (!backgroundColor) {\n return config;\n }\n config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);\n return config;\n });\n config = withAndroidStyles(config, (config) => {\n config.modResults = removeOldSplashStyleGroup(config.modResults);\n config.modResults = addSplashScreenStyle(\n config.modResults,\n isLegacyConfig,\n splashConfig?.enableFullScreenImage_legacy ?? false\n );\n return config;\n });\n return config;\n};\n\n// Add the style that extends Theme.SplashScreen\nfunction addSplashScreenStyle(\n styles: AndroidConfig.Resources.ResourceXML,\n isLegacyConfig: boolean,\n enableFullScreen: boolean\n) {\n const { resources } = styles;\n const { style = [] } = resources;\n\n let item;\n if (isLegacyConfig) {\n item = [\n {\n $: { name: 'android:windowBackground' },\n _: '@drawable/ic_launcher_background',\n },\n ];\n } else {\n item = [\n {\n $: { name: 'windowSplashScreenBackground' },\n _: '@color/splashscreen_background',\n },\n enableFullScreen\n ? {\n $: { name: 'android:windowBackground' },\n _: '@drawable/splashscreen_logo',\n }\n : {\n $: { name: 'windowSplashScreenAnimatedIcon' },\n _: '@drawable/splashscreen_logo',\n },\n {\n $: { name: 'postSplashScreenTheme' },\n _: '@style/AppTheme',\n },\n ];\n }\n\n styles.resources.style = [\n ...style.filter(({ $ }) => $.name !== 'Theme.App.SplashScreen'),\n {\n $: {\n ...styleResourceGroup,\n parent: isLegacyConfig ? 'AppTheme' : 'Theme.SplashScreen',\n },\n item,\n },\n ];\n\n return styles;\n}\n\n// Remove the old style group which didn't extend the base theme properly.\nexport function removeOldSplashStyleGroup(styles: AndroidConfig.Resources.ResourceXML) {\n const group = {\n name: 'Theme.App.SplashScreen',\n parent: 'Theme.AppCompat.Light.NoActionBar',\n };\n\n styles.resources.style = styles.resources.style?.filter?.(({ $: head }) => {\n let matches = head.name === group.name;\n if (group.parent != null && matches) {\n matches = head.parent === group.parent;\n }\n return !matches;\n });\n\n return styles;\n}\n\nexport function getSplashBackgroundColor(\n config: ExpoConfig,\n props: AndroidSplashConfig | null\n): string | null {\n return getAndroidSplashConfig(config, props)?.backgroundColor ?? null;\n}\n\nexport function getSplashDarkBackgroundColor(\n config: ExpoConfig,\n props: AndroidSplashConfig | null\n): string | null {\n return getAndroidDarkSplashConfig(config, props)?.backgroundColor ?? null;\n}\n\nexport function setSplashStylesForTheme(styles: AndroidConfig.Resources.ResourceXML) {\n // Add splash screen image\n return AndroidConfig.Styles.assignStylesValue(styles, {\n add: true,\n value: '@drawable/splashscreen_logo',\n name: 'android:windowSplashScreenBackground',\n parent: styleResourceGroup,\n });\n}\n\nexport function setSplashColorsForTheme(\n colors: AndroidConfig.Resources.ResourceXML,\n backgroundColor: string | null\n): AndroidConfig.Resources.ResourceXML {\n return Colors.assignColorValue(colors, { value: backgroundColor, name: SPLASH_COLOR_NAME });\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,wBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,uBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,MAAMI,kBAAkB,GAAG;EACzBC,IAAI,EAAE,wBAAwB;EAC9BC,MAAM,EAAE;AACV,CAAC;AAED,MAAMC,iBAAiB,GAAG,yB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AAK,CAAC3B,IAAI;IACtC,IAAI2B,KAAK,CAAC1B,MAAM,IAAI,IAAI,IAAI4B,OAAO,EAAE;MACnCA,OAAO,GAAGD,IAAI,CAAC3B,MAAM,KAAK0B,KAAK,CAAC1B,MAAM;IACxC;IACA,OAAO,CAAC4B,OAAO;EACjB,CAAC,CAAC;EAEF,OAAOV,MAAM;AACf;AAEO,SAASV,wBAAwBA,CACtCL,MAAkB,EAClB0B,KAAiC,EAClB;EACf,OAAO,IAAAC,gDAAsB,EAAC3B,MAAM,EAAE0B,KAAK,CAAC,EAAEtB,eAAe,IAAI,IAAI;AACvE;AAEO,SAASK,4BAA4BA,CAC1CT,MAAkB,EAClB0B,KAAiC,EAClB;EACf,OAAO,IAAAE,oDAA0B,EAAC5B,MAAM,EAAE0B,KAAK,CAAC,EAAEtB,eAAe,IAAI,IAAI;AAC3E;AAEO,SAASyB,uBAAuBA,CAACd,MAA2C,EAAE;EACnF;EACA,OAAOe,8BAAa,CAACC,MAAM,CAACC,iBAAiB,CAACjB,MAAM,EAAE;IACpDkB,GAAG,EAAE,IAAI;IACTC,KAAK,EAAE,6BAA6B;IACpCtC,IAAI,EAAE,sCAAsC;IAC5CC,MAAM,EAAEF;EACV,CAAC,CAAC;AACJ;AAEO,SAASY,uBAAuBA,CACrC4B,MAA2C,EAC3C/B,eAA8B,EACO;EACrC,OAAOgC,iBAAM,CAACC,gBAAgB,CAACF,MAAM,EAAE;IAAED,KAAK,EAAE9B,eAAe;IAAER,IAAI,EAAEE;EAAkB,CAAC,CAAC;AAC7F","ignoreList":[]}
|
|
@@ -174,6 +174,10 @@ async function generateImagesAssetsAsync({
|
|
|
174
174
|
const items = [[anyItem, PNG_FILENAME], [darkItem, DARK_PNG_FILENAME], [tabletItem, TABLET_PNG_FILENAME], [darkTabletItem, DARK_TABLET_PNG_FILENAME]].filter(([item]) => !!item);
|
|
175
175
|
await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));
|
|
176
176
|
}
|
|
177
|
+
const lightAppearances = [{
|
|
178
|
+
appearance: 'luminosity',
|
|
179
|
+
value: 'light'
|
|
180
|
+
}];
|
|
177
181
|
const darkAppearances = [{
|
|
178
182
|
appearance: 'luminosity',
|
|
179
183
|
value: 'dark'
|
|
@@ -188,14 +192,17 @@ function buildContentsJsonImages({
|
|
|
188
192
|
// Phone light
|
|
189
193
|
(0, _AssetContents().createContentsJsonItem)({
|
|
190
194
|
idiom: 'universal',
|
|
195
|
+
appearances: lightAppearances,
|
|
191
196
|
filename: `${image}.png`,
|
|
192
197
|
scale: '1x'
|
|
193
198
|
}), (0, _AssetContents().createContentsJsonItem)({
|
|
194
199
|
idiom: 'universal',
|
|
200
|
+
appearances: lightAppearances,
|
|
195
201
|
filename: `${image}@2x.png`,
|
|
196
202
|
scale: '2x'
|
|
197
203
|
}), (0, _AssetContents().createContentsJsonItem)({
|
|
198
204
|
idiom: 'universal',
|
|
205
|
+
appearances: lightAppearances,
|
|
199
206
|
filename: `${image}@3x.png`,
|
|
200
207
|
scale: '3x'
|
|
201
208
|
}),
|
|
@@ -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","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","imageWidth","enableFullScreenImage","enableFullScreenImage_legacy","exports","imageSetPath","path","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","generateImagesAssetsAsync","generateImageAsset","item","fileName","ratio","suffix","map","size","source","generateImageAsync","cacheType","src","width","undefined","height","writeFile","anyItem","darkItem","tabletItem","darkTabletItem","items","filter","Promise","all","darkAppearances","appearance","value","buildContentsJsonImages","createContentsJsonItem","idiom","filename","scale","appearances","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 ContentsJsonAppearance,\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 imageWidth: splash.imageWidth ?? 100,\n enableFullScreenImage: splash.enableFullScreenImage_legacy,\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 imageWidth,\n enableFullScreenImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage?: string;\n darkTabletImage?: string | null;\n imageWidth: number;\n enableFullScreenImage?: boolean;\n}) {\n const imageSetPath = path.resolve(iosNamedProjectRoot, IMAGESET_PATH);\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 imageWidth,\n enableFullScreenImage,\n });\n}\n\nasync function copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n imageWidth,\n enableFullScreenImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n imageWidth: number;\n enableFullScreenImage?: boolean;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n [\n { ratio: 1, suffix: '' },\n { ratio: 2, suffix: '@2x' },\n { ratio: 3, suffix: '@3x' },\n ].map(async ({ ratio, suffix }) => {\n const size = imageWidth * ratio;\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 width: enableFullScreenImage ? undefined : size,\n height: enableFullScreenImage ? undefined : size,\n } as any);\n // Write image buffer to the file system.\n // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(\n path.resolve(iosNamedProjectRoot, IMAGESET_PATH, `${fileName}${suffix}.png`),\n source\n );\n });\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: ContentsJsonAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonAppearance,\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 filename: `${darkImage}.png`,\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n filename: `${darkImage}@2x.png`,\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n filename: `${darkImage}@3x.png`,\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: `${tabletImage}.png`,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n filename: `${tabletImage}@2x.png`,\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: `${darkTabletImage}.png`,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: `${darkTabletImage}@2x.png`,\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;AAEA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAK,KAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;E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;IACbC,QAAQ,EAAE,GAAG5C,WAAW,MAAM;IAC9B6C,KAAK,EAAE;EACT,CAAC,CAAC,EACJ7C,WAAW,IACT,IAAA0C,uCAAsB,EAAC;IACrBC,KAAK,EAAE,MAAM;IACbE,KAAK,EAAE,IAAI;IACXD,QAAQ,EAAE,GAAG5C,WAAW;EAC1B,CAAC,CAAC;EACJ;EACAC,eAAe,IACb,IAAAyC,uCAAsB,EAAC;IACrBC,KAAK,EAAE,MAAM;IACbG,WAAW,EAAER,eAAe;IAC5BM,QAAQ,EAAE,GAAG3C,eAAe,MAAM;IAClC4C,KAAK,EAAE;EACT,CAAC,CAAC,EACJ5C,eAAe,IACb,IAAAyC,uCAAsB,EAAC;IACrBC,KAAK,EAAE,MAAM;IACbG,WAAW,EAAER,eAAe;IAC5BM,QAAQ,EAAE,GAAG3C,eAAe,SAAS;IACrC4C,KAAK,EAAE;EACT,CAAC,CAAC,CACL,CAACV,MAAM,CAACY,OAAO,CAAC;AACnB;AAEA,eAAepC,0BAA0BA,CAAC;EACxCC,SAAS;EACTf,KAAK;EACLC,SAAS;EACTE,WAAW;EACXC;AAOF,CAAC,EAAE;EACD,MAAM+C,MAAM,GAAGP,uBAAuB,CAAC;IAAE5C,KAAK;IAAEC,SAAS;IAAEE,WAAW;IAAEC;EAAgB,CAAC,CAAC;EAE1FvB,KAAK,CAAC,uBAAuB,EAAEkC,SAAS,CAAC;EACzClC,KAAK,CAAC,aAAa,EAAEsE,MAAM,CAAC;EAC5B,MAAM,IAAAC,uCAAsB,EAACrC,SAAS,EAAE;IAAEoC;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","imageWidth","enableFullScreenImage","enableFullScreenImage_legacy","exports","imageSetPath","path","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","generateImagesAssetsAsync","generateImageAsset","item","fileName","ratio","suffix","map","size","source","generateImageAsync","cacheType","src","width","undefined","height","writeFile","anyItem","darkItem","tabletItem","darkTabletItem","items","filter","Promise","all","lightAppearances","appearance","value","darkAppearances","buildContentsJsonImages","createContentsJsonItem","idiom","appearances","filename","scale","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 ContentsJsonAppearance,\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 imageWidth: splash.imageWidth ?? 100,\n enableFullScreenImage: splash.enableFullScreenImage_legacy,\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 imageWidth,\n enableFullScreenImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage?: string;\n darkTabletImage?: string | null;\n imageWidth: number;\n enableFullScreenImage?: boolean;\n}) {\n const imageSetPath = path.resolve(iosNamedProjectRoot, IMAGESET_PATH);\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 imageWidth,\n enableFullScreenImage,\n });\n}\n\nasync function copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n imageWidth,\n enableFullScreenImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n imageWidth: number;\n enableFullScreenImage?: boolean;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n [\n { ratio: 1, suffix: '' },\n { ratio: 2, suffix: '@2x' },\n { ratio: 3, suffix: '@3x' },\n ].map(async ({ ratio, suffix }) => {\n const size = imageWidth * ratio;\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 width: enableFullScreenImage ? undefined : size,\n height: enableFullScreenImage ? undefined : size,\n } as any);\n // Write image buffer to the file system.\n // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(\n path.resolve(iosNamedProjectRoot, IMAGESET_PATH, `${fileName}${suffix}.png`),\n source\n );\n });\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 lightAppearances: ContentsJsonAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'light',\n } as ContentsJsonAppearance,\n];\n\nconst darkAppearances: ContentsJsonAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonAppearance,\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 appearances: lightAppearances,\n filename: `${image}.png`,\n scale: '1x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n appearances: lightAppearances,\n filename: `${image}@2x.png`,\n scale: '2x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n appearances: lightAppearances,\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 filename: `${darkImage}.png`,\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n filename: `${darkImage}@2x.png`,\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n filename: `${darkImage}@3x.png`,\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: `${tabletImage}.png`,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n filename: `${tabletImage}@2x.png`,\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: `${darkTabletImage}.png`,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: `${darkTabletImage}@2x.png`,\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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AAC,CAAC,CACL,CAACZ,MAAM,CAACa,OAAO,CAAC;AACnB;AAEA,eAAerC,0BAA0BA,CAAC;EACxCC,SAAS;EACTf,KAAK;EACLC,SAAS;EACTE,WAAW;EACXC;AAOF,CAAC,EAAE;EACD,MAAMgD,MAAM,GAAGP,uBAAuB,CAAC;IAAE7C,KAAK;IAAEC,SAAS;IAAEE,WAAW;IAAEC;EAAgB,CAAC,CAAC;EAE1FvB,KAAK,CAAC,uBAAuB,EAAEkC,SAAS,CAAC;EACzClC,KAAK,CAAC,aAAa,EAAEuE,MAAM,CAAC;EAC5B,MAAM,IAAAC,uCAAsB,EAACtC,SAAS,EAAE;IAAEqC;EAAO,CAAC,CAAC;AACrD","ignoreList":[]}
|
|
@@ -93,7 +93,11 @@ async function writeColorsContentsJsonFileAsync({
|
|
|
93
93
|
},
|
|
94
94
|
'color-space': 'srgb'
|
|
95
95
|
},
|
|
96
|
-
idiom: 'universal'
|
|
96
|
+
idiom: 'universal',
|
|
97
|
+
appearances: [{
|
|
98
|
+
appearance: 'luminosity',
|
|
99
|
+
value: 'light'
|
|
100
|
+
}]
|
|
97
101
|
}];
|
|
98
102
|
if (darkColor) {
|
|
99
103
|
colors.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosSplashColors.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","_fsExtra","_path","_interopRequireWildcard","_InterfaceBuilder","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","debug","Debug","SPLASHSCREEN_COLORSET_PATH","exports","withIosSplashColors","config","splash","withDangerousMod","iosNamedProjectRoot","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","configureColorAssets","backgroundColor","darkBackgroundColor","dark","colorsetPath","path","resolve","fs","remove","writeColorsContentsJsonFileAsync","assetPath","color","parseColor","darkColor","colors","components","alpha","blue","rgb","green","red","idiom","
|
|
1
|
+
{"version":3,"file":"withIosSplashColors.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","_fsExtra","_path","_interopRequireWildcard","_InterfaceBuilder","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","debug","Debug","SPLASHSCREEN_COLORSET_PATH","exports","withIosSplashColors","config","splash","withDangerousMod","iosNamedProjectRoot","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","configureColorAssets","backgroundColor","darkBackgroundColor","dark","colorsetPath","path","resolve","fs","remove","writeColorsContentsJsonFileAsync","assetPath","color","parseColor","darkColor","colors","components","alpha","blue","rgb","green","red","idiom","appearances","appearance","value","push","writeContentsJsonAsync","directory","ensureDir","writeFile","join","JSON","stringify","info","version","author"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashColors.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';\nimport Debug from 'debug';\nimport fs from 'fs-extra';\n// @ts-ignore\nimport path, { join } from 'path';\n\nimport { parseColor } from './InterfaceBuilder';\nimport { IOSSplashConfig } from './getIosSplashConfig';\nimport { ContentsJsonColor } from '../../icons/AssetContents';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:splash-colorset');\n\nexport const SPLASHSCREEN_COLORSET_PATH = 'Images.xcassets/SplashScreenBackground.colorset';\n\nexport const withIosSplashColors: 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 configureColorAssets({\n iosNamedProjectRoot,\n backgroundColor: splash.backgroundColor,\n darkBackgroundColor: splash.dark?.backgroundColor,\n });\n return config;\n },\n ]);\n};\n\nasync function configureColorAssets({\n iosNamedProjectRoot,\n backgroundColor = '#ffffff',\n darkBackgroundColor,\n}: {\n iosNamedProjectRoot: string;\n backgroundColor: string;\n darkBackgroundColor?: string | null;\n}) {\n const colorsetPath = path.resolve(iosNamedProjectRoot, SPLASHSCREEN_COLORSET_PATH);\n\n // ensure old SplashScreen colorSet is removed\n await fs.remove(colorsetPath);\n\n await writeColorsContentsJsonFileAsync({\n assetPath: colorsetPath,\n backgroundColor,\n darkBackgroundColor: darkBackgroundColor ?? null,\n });\n}\n\nasync function writeColorsContentsJsonFileAsync({\n assetPath,\n backgroundColor,\n darkBackgroundColor,\n}: {\n assetPath: string;\n backgroundColor: string;\n darkBackgroundColor: string | null;\n}) {\n const color = parseColor(backgroundColor);\n const darkColor = darkBackgroundColor ? parseColor(darkBackgroundColor) : null;\n\n const colors: ContentsJsonColor[] = [\n {\n color: {\n components: {\n alpha: '1.000',\n blue: color.rgb.blue,\n green: color.rgb.green,\n red: color.rgb.red,\n },\n 'color-space': 'srgb',\n },\n idiom: 'universal',\n appearances: [\n {\n appearance: 'luminosity',\n value: 'light',\n },\n ],\n },\n ];\n\n if (darkColor) {\n colors.push({\n color: {\n components: {\n alpha: '1.000',\n blue: darkColor.rgb.blue,\n green: darkColor.rgb.green,\n red: darkColor.rgb.red,\n },\n 'color-space': 'srgb',\n },\n idiom: 'universal',\n appearances: [\n {\n appearance: 'luminosity',\n value: 'dark',\n },\n ],\n });\n }\n debug(`create colors contents.json:`, assetPath);\n debug(`use colors:`, colors);\n await writeContentsJsonAsync(assetPath, { colors });\n}\n\nasync function writeContentsJsonAsync(\n directory: string,\n { colors }: { colors: ContentsJsonColor[] }\n): Promise<void> {\n await fs.ensureDir(directory);\n\n await fs.writeFile(\n join(directory, 'Contents.json'),\n JSON.stringify(\n {\n colors,\n info: {\n version: 1,\n // common practice is for the tool that generated the icons to be the \"author\"\n author: 'expo',\n },\n },\n null,\n 2\n )\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAA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,GAAG,CAACE;QACrB,CAAC;QACD,aAAa,EAAE;MACjB,CAAC;MACDC,KAAK,EAAE,WAAW;MAClBC,WAAW,EAAE,CACX;QACEC,UAAU,EAAE,YAAY;QACxBC,KAAK,EAAE;MACT,CAAC;IAEL,CAAC,CAAC;EACJ;EACAtC,KAAK,CAAC,8BAA8B,EAAEwB,SAAS,CAAC;EAChDxB,KAAK,CAAC,aAAa,EAAE4B,MAAM,CAAC;EAC5B,MAAMY,sBAAsB,CAAChB,SAAS,EAAE;IAAEI;EAAO,CAAC,CAAC;AACrD;AAEA,eAAeY,sBAAsBA,CACnCC,SAAiB,EACjB;EAAEb;AAAwC,CAAC,EAC5B;EACf,MAAMP,kBAAE,CAACqB,SAAS,CAACD,SAAS,CAAC;EAE7B,MAAMpB,kBAAE,CAACsB,SAAS,CAChB,IAAAC,YAAI,EAACH,SAAS,EAAE,eAAe,CAAC,EAChCI,IAAI,CAACC,SAAS,CACZ;IACElB,MAAM;IACNmB,IAAI,EAAE;MACJC,OAAO,EAAE,CAAC;MACV;MACAC,MAAM,EAAE;IACV;EACF,CAAC,EACD,IAAI,EACJ,CACF,CACF,CAAC;AACH","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/prebuild-config",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.22",
|
|
4
4
|
"description": "Get the prebuild config",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "cc9b120d0f3c71f546db69e8adf4f0f3e9d5c14a"
|
|
56
56
|
}
|