@expo/prebuild-config 8.0.14 → 8.0.16
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/withAndroidIcons.d.ts +1 -1
- package/build/plugins/icons/withAndroidIcons.js +27 -66
- package/build/plugins/icons/withAndroidIcons.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js +5 -4
- package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js +6 -3
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js.map +1 -1
- package/package.json +3 -3
|
@@ -34,6 +34,6 @@ export declare function setIconAsync(projectRoot: string, { icon, backgroundColo
|
|
|
34
34
|
* - A backgroundImage is provided, or
|
|
35
35
|
* - A backgroundColor was specified
|
|
36
36
|
*/
|
|
37
|
-
export declare function configureAdaptiveIconAsync(projectRoot: string, foregroundImage: string, backgroundImage: string | null,
|
|
37
|
+
export declare function configureAdaptiveIconAsync(projectRoot: string, foregroundImage: string, backgroundImage: string | null, monochromeImage: string | null, isAdaptive: boolean): Promise<void>;
|
|
38
38
|
export declare const createAdaptiveIconXmlString: (backgroundImage: string | null, monochromeImage: string | null) => string;
|
|
39
39
|
export {};
|
|
@@ -72,8 +72,8 @@ const dpiValues = exports.dpiValues = {
|
|
|
72
72
|
scale: 4
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
const
|
|
76
|
-
const
|
|
75
|
+
const LEGACY_BASELINE_PIXEL_SIZE = 48;
|
|
76
|
+
const ADAPTIVE_BASELINE_PIXEL_SIZE = 108;
|
|
77
77
|
const ANDROID_RES_PATH = exports.ANDROID_RES_PATH = 'android/app/src/main/res/';
|
|
78
78
|
const MIPMAP_ANYDPI_V26 = 'mipmap-anydpi-v26';
|
|
79
79
|
const ICON_BACKGROUND = 'iconBackground';
|
|
@@ -159,7 +159,7 @@ async function setIconAsync(projectRoot, {
|
|
|
159
159
|
} else {
|
|
160
160
|
await deleteIconNamedAsync(projectRoot, IC_LAUNCHER_ROUND_WEBP);
|
|
161
161
|
}
|
|
162
|
-
await configureAdaptiveIconAsync(projectRoot, icon, backgroundImage,
|
|
162
|
+
await configureAdaptiveIconAsync(projectRoot, icon, backgroundImage, monochromeImage, isAdaptive);
|
|
163
163
|
return true;
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -187,7 +187,8 @@ async function generateRoundIconAsync(projectRoot, icon, backgroundImage, backgr
|
|
|
187
187
|
backgroundImage,
|
|
188
188
|
backgroundColor,
|
|
189
189
|
imageCacheFolder: 'android-standard-circle',
|
|
190
|
-
backgroundImageCacheFolder: 'android-standard-round-background'
|
|
190
|
+
backgroundImageCacheFolder: 'android-standard-round-background',
|
|
191
|
+
isAdaptive: false
|
|
191
192
|
});
|
|
192
193
|
}
|
|
193
194
|
|
|
@@ -197,7 +198,7 @@ async function generateRoundIconAsync(projectRoot, icon, backgroundImage, backgr
|
|
|
197
198
|
* - A backgroundImage is provided, or
|
|
198
199
|
* - A backgroundColor was specified
|
|
199
200
|
*/
|
|
200
|
-
async function configureAdaptiveIconAsync(projectRoot, foregroundImage, backgroundImage,
|
|
201
|
+
async function configureAdaptiveIconAsync(projectRoot, foregroundImage, backgroundImage, monochromeImage, isAdaptive) {
|
|
201
202
|
if (monochromeImage) {
|
|
202
203
|
await generateMonochromeImageAsync(projectRoot, {
|
|
203
204
|
icon: monochromeImage,
|
|
@@ -206,13 +207,14 @@ async function configureAdaptiveIconAsync(projectRoot, foregroundImage, backgrou
|
|
|
206
207
|
});
|
|
207
208
|
}
|
|
208
209
|
await generateMultiLayerImageAsync(projectRoot, {
|
|
209
|
-
backgroundColor,
|
|
210
|
+
backgroundColor: 'transparent',
|
|
210
211
|
backgroundImage,
|
|
211
212
|
backgroundImageCacheFolder: 'android-adaptive-background',
|
|
212
213
|
outputImageFileName: IC_LAUNCHER_FOREGROUND_WEBP,
|
|
213
214
|
icon: foregroundImage,
|
|
214
215
|
imageCacheFolder: 'android-adaptive-foreground',
|
|
215
|
-
backgroundImageFileName: IC_LAUNCHER_BACKGROUND_WEBP
|
|
216
|
+
backgroundImageFileName: IC_LAUNCHER_BACKGROUND_WEBP,
|
|
217
|
+
isAdaptive: true
|
|
216
218
|
});
|
|
217
219
|
|
|
218
220
|
// create ic_launcher.xml and ic_launcher_round.xml
|
|
@@ -229,7 +231,7 @@ function setBackgroundColor(backgroundColor, colors) {
|
|
|
229
231
|
});
|
|
230
232
|
}
|
|
231
233
|
const createAdaptiveIconXmlString = (backgroundImage, monochromeImage) => {
|
|
232
|
-
const background = backgroundImage ? `@
|
|
234
|
+
const background = backgroundImage ? `@mipmap/ic_launcher_background` : `@color/iconBackground`;
|
|
233
235
|
const iconElements = [`<background android:drawable="${background}"/>`, '<foreground android:drawable="@mipmap/ic_launcher_foreground"/>'];
|
|
234
236
|
if (monochromeImage) {
|
|
235
237
|
iconElements.push('<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>');
|
|
@@ -264,7 +266,8 @@ async function generateMultiLayerImageAsync(projectRoot, {
|
|
|
264
266
|
backgroundImageCacheFolder,
|
|
265
267
|
borderRadiusRatio,
|
|
266
268
|
outputImageFileName,
|
|
267
|
-
backgroundImageFileName
|
|
269
|
+
backgroundImageFileName,
|
|
270
|
+
isAdaptive
|
|
268
271
|
}) {
|
|
269
272
|
await iterateDpiValues(projectRoot, async ({
|
|
270
273
|
dpiFolder,
|
|
@@ -274,17 +277,19 @@ async function generateMultiLayerImageAsync(projectRoot, {
|
|
|
274
277
|
cacheType: imageCacheFolder,
|
|
275
278
|
src: icon,
|
|
276
279
|
scale,
|
|
277
|
-
|
|
280
|
+
// backgroundImage overrides backgroundColor
|
|
281
|
+
backgroundColor: backgroundImage ? 'transparent' : backgroundColor ?? 'transparent',
|
|
278
282
|
borderRadiusRatio,
|
|
279
|
-
|
|
283
|
+
isAdaptive
|
|
280
284
|
});
|
|
281
285
|
if (backgroundImage) {
|
|
282
286
|
const backgroundLayer = await generateIconAsync(projectRoot, {
|
|
283
287
|
cacheType: backgroundImageCacheFolder,
|
|
284
288
|
src: backgroundImage,
|
|
285
289
|
scale,
|
|
286
|
-
backgroundColor:
|
|
287
|
-
borderRadiusRatio
|
|
290
|
+
backgroundColor: 'transparent',
|
|
291
|
+
borderRadiusRatio,
|
|
292
|
+
isAdaptive
|
|
288
293
|
});
|
|
289
294
|
if (backgroundImageFileName) {
|
|
290
295
|
await _fsExtra().default.writeFile(_path().default.resolve(dpiFolder, backgroundImageFileName), backgroundLayer);
|
|
@@ -315,7 +320,8 @@ async function generateMonochromeImageAsync(projectRoot, {
|
|
|
315
320
|
cacheType: imageCacheFolder,
|
|
316
321
|
src: icon,
|
|
317
322
|
scale,
|
|
318
|
-
backgroundColor: 'transparent'
|
|
323
|
+
backgroundColor: 'transparent',
|
|
324
|
+
isAdaptive: true
|
|
319
325
|
});
|
|
320
326
|
await _fsExtra().default.ensureDir(dpiFolder);
|
|
321
327
|
await _fsExtra().default.writeFile(_path().default.resolve(dpiFolder, outputImageFileName), monochromeIcon);
|
|
@@ -340,64 +346,19 @@ async function generateIconAsync(projectRoot, {
|
|
|
340
346
|
scale,
|
|
341
347
|
backgroundColor,
|
|
342
348
|
borderRadiusRatio,
|
|
343
|
-
|
|
349
|
+
isAdaptive
|
|
344
350
|
}) {
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
const bgIconSizePx = Math.round(baseline * scale);
|
|
348
|
-
const iconSizePx = Math.round(bgIconSizePx * getImageScale(imageStlye ?? 'background'));
|
|
349
|
-
const {
|
|
350
|
-
source: foreground
|
|
351
|
-
} = await (0, _imageUtils().generateImageAsync)({
|
|
351
|
+
const iconSizePx = (isAdaptive ? ADAPTIVE_BASELINE_PIXEL_SIZE : LEGACY_BASELINE_PIXEL_SIZE) * scale;
|
|
352
|
+
return (await (0, _imageUtils().generateImageAsync)({
|
|
352
353
|
projectRoot,
|
|
353
354
|
cacheType
|
|
354
355
|
}, {
|
|
355
356
|
src,
|
|
356
|
-
resizeMode: 'cover',
|
|
357
357
|
width: iconSizePx,
|
|
358
|
-
height: iconSizePx
|
|
359
|
-
});
|
|
360
|
-
const background = await (0, _imageUtils().generateImageBackgroundAsync)({
|
|
361
|
-
width: bgIconSizePx,
|
|
362
|
-
height: bgIconSizePx,
|
|
363
|
-
backgroundColor: isForegound ? 'transparent' : backgroundColor,
|
|
358
|
+
height: iconSizePx,
|
|
364
359
|
resizeMode: 'cover',
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
const y = x;
|
|
369
|
-
return (0, _imageUtils().compositeImagesAsync)({
|
|
370
|
-
background,
|
|
371
|
-
foreground,
|
|
372
|
-
x,
|
|
373
|
-
y
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
function getImageStyle(outputFileName) {
|
|
377
|
-
switch (outputFileName) {
|
|
378
|
-
case IC_LAUNCHER_WEBP:
|
|
379
|
-
return 'legacy';
|
|
380
|
-
case IC_LAUNCHER_BACKGROUND_WEBP:
|
|
381
|
-
return 'background';
|
|
382
|
-
case IC_LAUNCHER_FOREGROUND_WEBP:
|
|
383
|
-
return 'foreground';
|
|
384
|
-
case IC_LAUNCHER_ROUND_WEBP:
|
|
385
|
-
return 'rounded';
|
|
386
|
-
case IC_LAUNCHER_MONOCHROME_WEBP:
|
|
387
|
-
return 'monochrome';
|
|
388
|
-
}
|
|
389
|
-
return 'background';
|
|
390
|
-
}
|
|
391
|
-
function getImageScale(imageStyle) {
|
|
392
|
-
switch (imageStyle) {
|
|
393
|
-
case 'legacy':
|
|
394
|
-
case 'rounded':
|
|
395
|
-
return 0.9;
|
|
396
|
-
case 'foreground':
|
|
397
|
-
case 'background':
|
|
398
|
-
return 0.7;
|
|
399
|
-
case 'monochrome':
|
|
400
|
-
return 1;
|
|
401
|
-
}
|
|
360
|
+
backgroundColor,
|
|
361
|
+
borderRadius: borderRadiusRatio ? iconSizePx * borderRadiusRatio : undefined
|
|
362
|
+
})).source;
|
|
402
363
|
}
|
|
403
364
|
//# sourceMappingURL=withAndroidIcons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidIcons.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_withAndroidManifestIcons","e","__esModule","default","Colors","AndroidConfig","dpiValues","exports","mdpi","folderName","scale","hdpi","xhdpi","xxhdpi","xxxhdpi","ICON_BASELINE_PIXEL_SIZE","FOREGROUND_BASELINE_PIXEL_SIZE","ANDROID_RES_PATH","MIPMAP_ANYDPI_V26","ICON_BACKGROUND","IC_LAUNCHER_WEBP","IC_LAUNCHER_ROUND_WEBP","IC_LAUNCHER_BACKGROUND_WEBP","IC_LAUNCHER_FOREGROUND_WEBP","IC_LAUNCHER_MONOCHROME_WEBP","IC_LAUNCHER_XML","IC_LAUNCHER_ROUND_XML","withAndroidIcons","config","foregroundImage","backgroundColor","backgroundImage","monochromeImage","getAdaptiveIcon","icon","getIcon","withAndroidManifestIcons","withAndroidAdaptiveIconColors","withDangerousMod","setIconAsync","modRequest","projectRoot","isAdaptive","android","adaptiveIcon","setRoundIconManifest","manifest","application","Manifest","getMainApplicationOrThrow","$","withAndroidColors","modResults","setBackgroundColor","configureLegacyIconAsync","generateRoundIconAsync","deleteIconNamedAsync","configureAdaptiveIconAsync","generateMultiLayerImageAsync","outputImageFileName","imageCacheFolder","backgroundImageCacheFolder","borderRadiusRatio","generateMonochromeImageAsync","backgroundImageFileName","icLauncherXmlString","createAdaptiveIconXmlString","createAdaptiveIconXmlFiles","colors","assignColorValue","value","name","background","iconElements","push","join","add","anyDpiV26Directory","path","resolve","fs","ensureDir","launcherPath","launcherRoundPath","Promise","all","writeFile","map","existsSync","remove","iterateDpiValues","dpiFolder","iconLayer","generateIconAsync","cacheType","src","imageStlye","getImageStyle","backgroundLayer","compositeImagesAsync","foreground","monochromeIcon","callback","Object","values","isForegound","baseline","bgIconSizePx","Math","round","iconSizePx","getImageScale","source","generateImageAsync","resizeMode","width","height","generateImageBackgroundAsync","borderRadius","undefined","x","y","outputFileName","imageStyle"],"sources":["../../../src/plugins/icons/withAndroidIcons.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withDangerousMod,\n} from '@expo/config-plugins';\nimport { ResourceXML } from '@expo/config-plugins/build/android/Resources';\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 { withAndroidManifestIcons } from './withAndroidManifestIcons';\n\nconst { Colors } = AndroidConfig;\n\ntype DPIString = 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype dpiMap = Record<DPIString, { folderName: string; scale: number }>;\ntype ImageStyle = 'foreground' | 'background' | 'rounded' | 'monochrome' | 'legacy';\n\nexport const dpiValues: dpiMap = {\n mdpi: { folderName: 'mipmap-mdpi', scale: 1 },\n hdpi: { folderName: 'mipmap-hdpi', scale: 1.5 },\n xhdpi: { folderName: 'mipmap-xhdpi', scale: 2 },\n xxhdpi: { folderName: 'mipmap-xxhdpi', scale: 3 },\n xxxhdpi: { folderName: 'mipmap-xxxhdpi', scale: 4 },\n};\nconst ICON_BASELINE_PIXEL_SIZE = 48;\nconst FOREGROUND_BASELINE_PIXEL_SIZE = 108;\n\nexport const ANDROID_RES_PATH = 'android/app/src/main/res/';\nconst MIPMAP_ANYDPI_V26 = 'mipmap-anydpi-v26';\nconst ICON_BACKGROUND = 'iconBackground';\nconst IC_LAUNCHER_WEBP = 'ic_launcher.webp';\nconst IC_LAUNCHER_ROUND_WEBP = 'ic_launcher_round.webp';\nconst IC_LAUNCHER_BACKGROUND_WEBP = 'ic_launcher_background.webp';\nconst IC_LAUNCHER_FOREGROUND_WEBP = 'ic_launcher_foreground.webp';\nconst IC_LAUNCHER_MONOCHROME_WEBP = 'ic_launcher_monochrome.webp';\nconst IC_LAUNCHER_XML = 'ic_launcher.xml';\nconst IC_LAUNCHER_ROUND_XML = 'ic_launcher_round.xml';\n\nexport const withAndroidIcons: ConfigPlugin = (config) => {\n const { foregroundImage, backgroundColor, backgroundImage, monochromeImage } =\n getAdaptiveIcon(config);\n const icon = foregroundImage ?? getIcon(config);\n\n if (!icon) {\n return config;\n }\n\n config = withAndroidManifestIcons(config);\n // Apply colors.xml changes\n config = withAndroidAdaptiveIconColors(config, backgroundColor);\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setIconAsync(config.modRequest.projectRoot, {\n icon,\n backgroundColor,\n backgroundImage,\n monochromeImage,\n isAdaptive: !!config.android?.adaptiveIcon,\n });\n return config;\n },\n ]);\n};\n\nexport function setRoundIconManifest(\n config: Pick<ExpoConfig, 'android'>,\n manifest: AndroidConfig.Manifest.AndroidManifest\n): AndroidConfig.Manifest.AndroidManifest {\n const isAdaptive = !!config.android?.adaptiveIcon;\n const application = AndroidConfig.Manifest.getMainApplicationOrThrow(manifest);\n\n if (isAdaptive) {\n application.$['android:roundIcon'] = '@mipmap/ic_launcher_round';\n } else {\n delete application.$['android:roundIcon'];\n }\n return manifest;\n}\n\nconst withAndroidAdaptiveIconColors: ConfigPlugin<string | null> = (config, backgroundColor) => {\n return withAndroidColors(config, (config) => {\n config.modResults = setBackgroundColor(backgroundColor ?? '#ffffff', config.modResults);\n return config;\n });\n};\n\nexport function getIcon(config: ExpoConfig) {\n return config.android?.icon || config.icon || null;\n}\n\nexport function getAdaptiveIcon(config: ExpoConfig) {\n return {\n foregroundImage: config.android?.adaptiveIcon?.foregroundImage ?? null,\n backgroundColor: config.android?.adaptiveIcon?.backgroundColor ?? null,\n backgroundImage: config.android?.adaptiveIcon?.backgroundImage ?? null,\n monochromeImage: config.android?.adaptiveIcon?.monochromeImage ?? null,\n };\n}\n\n/**\n * Resizes the user-provided icon to create a set of legacy icon files in\n * their respective \"mipmap\" directories for <= Android 7, and creates a set of adaptive\n * icon files for > Android 7 from the adaptive icon files (if provided).\n */\nexport async function setIconAsync(\n projectRoot: string,\n {\n icon,\n backgroundColor,\n backgroundImage,\n monochromeImage,\n isAdaptive,\n }: {\n icon: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n monochromeImage: string | null;\n isAdaptive: boolean;\n }\n) {\n if (!icon) {\n return null;\n }\n\n await configureLegacyIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n if (isAdaptive) {\n await generateRoundIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n } else {\n await deleteIconNamedAsync(projectRoot, IC_LAUNCHER_ROUND_WEBP);\n }\n await configureAdaptiveIconAsync(\n projectRoot,\n icon,\n backgroundImage,\n backgroundColor,\n monochromeImage,\n isAdaptive\n );\n\n return true;\n}\n\n/**\n * Configures legacy icon files to be used on Android 7 and earlier. If adaptive icon configuration\n * was provided, we create a pseudo-adaptive icon by layering the provided files (or background\n * color if no backgroundImage is provided. If no backgroundImage and no backgroundColor are provided,\n * the background is set to transparent.)\n */\nasync function configureLegacyIconAsync(\n projectRoot: string,\n icon: string,\n backgroundImage: string | null,\n backgroundColor: string | null\n) {\n return generateMultiLayerImageAsync(projectRoot, {\n icon,\n backgroundImage,\n backgroundColor,\n outputImageFileName: IC_LAUNCHER_WEBP,\n imageCacheFolder: 'android-standard-square',\n backgroundImageCacheFolder: 'android-standard-square-background',\n });\n}\n\nasync function generateRoundIconAsync(\n projectRoot: string,\n icon: string,\n backgroundImage: string | null,\n backgroundColor: string | null\n) {\n return generateMultiLayerImageAsync(projectRoot, {\n icon,\n borderRadiusRatio: 0.5,\n outputImageFileName: IC_LAUNCHER_ROUND_WEBP,\n backgroundImage,\n backgroundColor,\n imageCacheFolder: 'android-standard-circle',\n backgroundImageCacheFolder: 'android-standard-round-background',\n });\n}\n\n/**\n * Configures adaptive icon files to be used on Android 8 and up. A foreground image must be provided,\n * and will have a transparent background unless:\n * - A backgroundImage is provided, or\n * - A backgroundColor was specified\n */\nexport async function configureAdaptiveIconAsync(\n projectRoot: string,\n foregroundImage: string,\n backgroundImage: string | null,\n backgroundColor: string | null,\n monochromeImage: string | null,\n isAdaptive: boolean\n) {\n if (monochromeImage) {\n await generateMonochromeImageAsync(projectRoot, {\n icon: monochromeImage,\n imageCacheFolder: 'android-adaptive-monochrome',\n outputImageFileName: IC_LAUNCHER_MONOCHROME_WEBP,\n });\n }\n await generateMultiLayerImageAsync(projectRoot, {\n backgroundColor,\n backgroundImage,\n backgroundImageCacheFolder: 'android-adaptive-background',\n outputImageFileName: IC_LAUNCHER_FOREGROUND_WEBP,\n icon: foregroundImage,\n imageCacheFolder: 'android-adaptive-foreground',\n backgroundImageFileName: IC_LAUNCHER_BACKGROUND_WEBP,\n });\n\n // create ic_launcher.xml and ic_launcher_round.xml\n const icLauncherXmlString = createAdaptiveIconXmlString(backgroundImage, monochromeImage);\n await createAdaptiveIconXmlFiles(\n projectRoot,\n icLauncherXmlString,\n // If the user only defined icon and not android.adaptiveIcon, then skip enabling the layering system\n // this will scale the image down and present it uncropped.\n isAdaptive\n );\n}\n\nfunction setBackgroundColor(backgroundColor: string | null, colors: ResourceXML) {\n return Colors.assignColorValue(colors, {\n value: backgroundColor,\n name: ICON_BACKGROUND,\n });\n}\n\nexport const createAdaptiveIconXmlString = (\n backgroundImage: string | null,\n monochromeImage: string | null\n) => {\n const background = backgroundImage ? `@drawable/ic_launcher_background` : `@color/iconBackground`;\n\n const iconElements: string[] = [\n `<background android:drawable=\"${background}\"/>`,\n '<foreground android:drawable=\"@mipmap/ic_launcher_foreground\"/>',\n ];\n\n if (monochromeImage) {\n iconElements.push('<monochrome android:drawable=\"@mipmap/ic_launcher_monochrome\"/>');\n }\n\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n ${iconElements.join('\\n ')}\n</adaptive-icon>`;\n};\n\nasync function createAdaptiveIconXmlFiles(\n projectRoot: string,\n icLauncherXmlString: string,\n add: boolean\n) {\n const anyDpiV26Directory = path.resolve(projectRoot, ANDROID_RES_PATH, MIPMAP_ANYDPI_V26);\n await fs.ensureDir(anyDpiV26Directory);\n const launcherPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_XML);\n const launcherRoundPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_ROUND_XML);\n if (add) {\n await Promise.all([\n fs.writeFile(launcherPath, icLauncherXmlString),\n fs.writeFile(launcherRoundPath, icLauncherXmlString),\n ]);\n } else {\n // Remove the xml if the icon switches from adaptive to standard.\n await Promise.all(\n [launcherPath, launcherRoundPath].map(async (path) => {\n if (fs.existsSync(path)) {\n return fs.remove(path);\n }\n })\n );\n }\n}\n\nasync function generateMultiLayerImageAsync(\n projectRoot: string,\n {\n icon,\n backgroundColor,\n backgroundImage,\n imageCacheFolder,\n backgroundImageCacheFolder,\n borderRadiusRatio,\n outputImageFileName,\n backgroundImageFileName,\n }: {\n icon: string;\n backgroundImage: string | null;\n backgroundColor: string | null;\n imageCacheFolder: string;\n backgroundImageCacheFolder: string;\n backgroundImageFileName?: string;\n borderRadiusRatio?: number;\n outputImageFileName: string;\n }\n) {\n await iterateDpiValues(projectRoot, async ({ dpiFolder, scale }) => {\n let iconLayer = await generateIconAsync(projectRoot, {\n cacheType: imageCacheFolder,\n src: icon,\n scale,\n backgroundColor: backgroundColor ?? 'transparent',\n borderRadiusRatio,\n imageStlye: getImageStyle(outputImageFileName),\n });\n\n if (backgroundImage) {\n const backgroundLayer = await generateIconAsync(projectRoot, {\n cacheType: backgroundImageCacheFolder,\n src: backgroundImage,\n scale,\n backgroundColor: backgroundColor ?? 'transparent',\n borderRadiusRatio,\n });\n\n if (backgroundImageFileName) {\n await fs.writeFile(path.resolve(dpiFolder, backgroundImageFileName), backgroundLayer);\n } else {\n iconLayer = await compositeImagesAsync({\n foreground: iconLayer,\n background: backgroundLayer,\n });\n }\n } else if (backgroundImageFileName) {\n // Remove any instances of ic_launcher_background.png that are there from previous icons\n await deleteIconNamedAsync(projectRoot, backgroundImageFileName);\n }\n\n await fs.ensureDir(dpiFolder);\n await fs.writeFile(path.resolve(dpiFolder, outputImageFileName), iconLayer);\n });\n}\n\nasync function generateMonochromeImageAsync(\n projectRoot: string,\n {\n icon,\n imageCacheFolder,\n outputImageFileName,\n }: { icon: string; imageCacheFolder: string; outputImageFileName: string }\n) {\n await iterateDpiValues(projectRoot, async ({ dpiFolder, scale }) => {\n const monochromeIcon = await generateIconAsync(projectRoot, {\n cacheType: imageCacheFolder,\n src: icon,\n scale,\n backgroundColor: 'transparent',\n });\n await fs.ensureDir(dpiFolder);\n await fs.writeFile(path.resolve(dpiFolder, outputImageFileName), monochromeIcon);\n });\n}\n\nfunction iterateDpiValues(\n projectRoot: string,\n callback: (value: { dpiFolder: string; folderName: string; scale: number }) => Promise<void>\n) {\n return Promise.all(\n Object.values(dpiValues).map((value) =>\n callback({\n dpiFolder: path.resolve(projectRoot, ANDROID_RES_PATH, value.folderName),\n ...value,\n })\n )\n );\n}\n\nasync function deleteIconNamedAsync(projectRoot: string, name: string) {\n return iterateDpiValues(projectRoot, ({ dpiFolder }) => {\n return fs.remove(path.resolve(dpiFolder, name));\n });\n}\n\nasync function generateIconAsync(\n projectRoot: string,\n {\n cacheType,\n src,\n scale,\n backgroundColor,\n borderRadiusRatio,\n imageStlye,\n }: {\n cacheType: string;\n src: string;\n scale: number;\n backgroundColor: string;\n borderRadiusRatio?: number;\n imageStlye?: ImageStyle;\n }\n) {\n const isForegound = imageStlye === 'foreground';\n const baseline = isForegound ? FOREGROUND_BASELINE_PIXEL_SIZE : ICON_BASELINE_PIXEL_SIZE;\n const bgIconSizePx = Math.round(baseline * scale);\n const iconSizePx = Math.round(bgIconSizePx * getImageScale(imageStlye ?? 'background'));\n\n const { source: foreground } = await generateImageAsync(\n { projectRoot, cacheType },\n {\n src,\n resizeMode: 'cover',\n width: iconSizePx,\n height: iconSizePx,\n }\n );\n\n const background = await generateImageBackgroundAsync({\n width: bgIconSizePx,\n height: bgIconSizePx,\n backgroundColor: isForegound ? 'transparent' : backgroundColor,\n resizeMode: 'cover',\n borderRadius: borderRadiusRatio ? bgIconSizePx * borderRadiusRatio : undefined,\n });\n\n const x = Math.round((bgIconSizePx - iconSizePx) / 2);\n const y = x;\n\n return compositeImagesAsync({ background, foreground, x, y });\n}\n\nfunction getImageStyle(outputFileName: string): ImageStyle {\n switch (outputFileName) {\n case IC_LAUNCHER_WEBP:\n return 'legacy';\n case IC_LAUNCHER_BACKGROUND_WEBP:\n return 'background';\n case IC_LAUNCHER_FOREGROUND_WEBP:\n return 'foreground';\n case IC_LAUNCHER_ROUND_WEBP:\n return 'rounded';\n case IC_LAUNCHER_MONOCHROME_WEBP:\n return 'monochrome';\n }\n\n return 'background';\n}\n\nfunction getImageScale(imageStyle: ImageStyle) {\n switch (imageStyle) {\n case 'legacy':\n case 'rounded':\n return 0.9;\n case 'foreground':\n case 'background':\n return 0.7;\n case 'monochrome':\n return 1;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,0BAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,yBAAA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K,CAAC,CAACF,YAAY,GAAGG,UAAU,IAAI,CAAC,CAAC;EACrD,MAAMW,CAAC,GAAGD,CAAC;EAEX,OAAO,IAAArB,kCAAoB,EAAC;IAAE3B,UAAU;IAAE4B,UAAU;IAAEoB,CAAC;IAAEC;EAAE,CAAC,CAAC;AAC/D;AAEA,SAASxB,aAAaA,CAACyB,cAAsB,EAAc;EACzD,QAAQA,cAAc;IACpB,KAAKtG,gBAAgB;MACnB,OAAO,QAAQ;IACjB,KAAKE,2BAA2B;MAC9B,OAAO,YAAY;IACrB,KAAKC,2BAA2B;MAC9B,OAAO,YAAY;IACrB,KAAKF,sBAAsB;MACzB,OAAO,SAAS;IAClB,KAAKG,2BAA2B;MAC9B,OAAO,YAAY;EACvB;EAEA,OAAO,YAAY;AACrB;AAEA,SAASuF,aAAaA,CAACY,UAAsB,EAAE;EAC7C,QAAQA,UAAU;IAChB,KAAK,QAAQ;IACb,KAAK,SAAS;MACZ,OAAO,GAAG;IACZ,KAAK,YAAY;IACjB,KAAK,YAAY;MACf,OAAO,GAAG;IACZ,KAAK,YAAY;MACf,OAAO,CAAC;EACZ;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"withAndroidIcons.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_withAndroidManifestIcons","e","__esModule","default","Colors","AndroidConfig","dpiValues","exports","mdpi","folderName","scale","hdpi","xhdpi","xxhdpi","xxxhdpi","LEGACY_BASELINE_PIXEL_SIZE","ADAPTIVE_BASELINE_PIXEL_SIZE","ANDROID_RES_PATH","MIPMAP_ANYDPI_V26","ICON_BACKGROUND","IC_LAUNCHER_WEBP","IC_LAUNCHER_ROUND_WEBP","IC_LAUNCHER_BACKGROUND_WEBP","IC_LAUNCHER_FOREGROUND_WEBP","IC_LAUNCHER_MONOCHROME_WEBP","IC_LAUNCHER_XML","IC_LAUNCHER_ROUND_XML","withAndroidIcons","config","foregroundImage","backgroundColor","backgroundImage","monochromeImage","getAdaptiveIcon","icon","getIcon","withAndroidManifestIcons","withAndroidAdaptiveIconColors","withDangerousMod","setIconAsync","modRequest","projectRoot","isAdaptive","android","adaptiveIcon","setRoundIconManifest","manifest","application","Manifest","getMainApplicationOrThrow","$","withAndroidColors","modResults","setBackgroundColor","configureLegacyIconAsync","generateRoundIconAsync","deleteIconNamedAsync","configureAdaptiveIconAsync","generateMultiLayerImageAsync","outputImageFileName","imageCacheFolder","backgroundImageCacheFolder","borderRadiusRatio","generateMonochromeImageAsync","backgroundImageFileName","icLauncherXmlString","createAdaptiveIconXmlString","createAdaptiveIconXmlFiles","colors","assignColorValue","value","name","background","iconElements","push","join","add","anyDpiV26Directory","path","resolve","fs","ensureDir","launcherPath","launcherRoundPath","Promise","all","writeFile","map","existsSync","remove","iterateDpiValues","dpiFolder","iconLayer","generateIconAsync","cacheType","src","backgroundLayer","compositeImagesAsync","foreground","monochromeIcon","callback","Object","values","iconSizePx","generateImageAsync","width","height","resizeMode","borderRadius","undefined","source"],"sources":["../../../src/plugins/icons/withAndroidIcons.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withDangerousMod,\n} from '@expo/config-plugins';\nimport { ResourceXML } from '@expo/config-plugins/build/android/Resources';\nimport { ExpoConfig } from '@expo/config-types';\nimport { compositeImagesAsync, generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport { withAndroidManifestIcons } from './withAndroidManifestIcons';\n\nconst { Colors } = AndroidConfig;\n\ntype DPIString = 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype dpiMap = Record<DPIString, { folderName: string; scale: number }>;\n\nexport const dpiValues: dpiMap = {\n mdpi: { folderName: 'mipmap-mdpi', scale: 1 },\n hdpi: { folderName: 'mipmap-hdpi', scale: 1.5 },\n xhdpi: { folderName: 'mipmap-xhdpi', scale: 2 },\n xxhdpi: { folderName: 'mipmap-xxhdpi', scale: 3 },\n xxxhdpi: { folderName: 'mipmap-xxxhdpi', scale: 4 },\n};\n\nconst LEGACY_BASELINE_PIXEL_SIZE = 48;\nconst ADAPTIVE_BASELINE_PIXEL_SIZE = 108;\n\nexport const ANDROID_RES_PATH = 'android/app/src/main/res/';\nconst MIPMAP_ANYDPI_V26 = 'mipmap-anydpi-v26';\nconst ICON_BACKGROUND = 'iconBackground';\nconst IC_LAUNCHER_WEBP = 'ic_launcher.webp';\nconst IC_LAUNCHER_ROUND_WEBP = 'ic_launcher_round.webp';\nconst IC_LAUNCHER_BACKGROUND_WEBP = 'ic_launcher_background.webp';\nconst IC_LAUNCHER_FOREGROUND_WEBP = 'ic_launcher_foreground.webp';\nconst IC_LAUNCHER_MONOCHROME_WEBP = 'ic_launcher_monochrome.webp';\nconst IC_LAUNCHER_XML = 'ic_launcher.xml';\nconst IC_LAUNCHER_ROUND_XML = 'ic_launcher_round.xml';\n\nexport const withAndroidIcons: ConfigPlugin = (config) => {\n const { foregroundImage, backgroundColor, backgroundImage, monochromeImage } =\n getAdaptiveIcon(config);\n const icon = foregroundImage ?? getIcon(config);\n\n if (!icon) {\n return config;\n }\n\n config = withAndroidManifestIcons(config);\n // Apply colors.xml changes\n config = withAndroidAdaptiveIconColors(config, backgroundColor);\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setIconAsync(config.modRequest.projectRoot, {\n icon,\n backgroundColor,\n backgroundImage,\n monochromeImage,\n isAdaptive: !!config.android?.adaptiveIcon,\n });\n return config;\n },\n ]);\n};\n\nexport function setRoundIconManifest(\n config: Pick<ExpoConfig, 'android'>,\n manifest: AndroidConfig.Manifest.AndroidManifest\n): AndroidConfig.Manifest.AndroidManifest {\n const isAdaptive = !!config.android?.adaptiveIcon;\n const application = AndroidConfig.Manifest.getMainApplicationOrThrow(manifest);\n\n if (isAdaptive) {\n application.$['android:roundIcon'] = '@mipmap/ic_launcher_round';\n } else {\n delete application.$['android:roundIcon'];\n }\n return manifest;\n}\n\nconst withAndroidAdaptiveIconColors: ConfigPlugin<string | null> = (config, backgroundColor) => {\n return withAndroidColors(config, (config) => {\n config.modResults = setBackgroundColor(backgroundColor ?? '#ffffff', config.modResults);\n return config;\n });\n};\n\nexport function getIcon(config: ExpoConfig) {\n return config.android?.icon || config.icon || null;\n}\n\nexport function getAdaptiveIcon(config: ExpoConfig) {\n return {\n foregroundImage: config.android?.adaptiveIcon?.foregroundImage ?? null,\n backgroundColor: config.android?.adaptiveIcon?.backgroundColor ?? null,\n backgroundImage: config.android?.adaptiveIcon?.backgroundImage ?? null,\n monochromeImage: config.android?.adaptiveIcon?.monochromeImage ?? null,\n };\n}\n\n/**\n * Resizes the user-provided icon to create a set of legacy icon files in\n * their respective \"mipmap\" directories for <= Android 7, and creates a set of adaptive\n * icon files for > Android 7 from the adaptive icon files (if provided).\n */\nexport async function setIconAsync(\n projectRoot: string,\n {\n icon,\n backgroundColor,\n backgroundImage,\n monochromeImage,\n isAdaptive,\n }: {\n icon: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n monochromeImage: string | null;\n isAdaptive: boolean;\n }\n) {\n if (!icon) {\n return null;\n }\n\n await configureLegacyIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n if (isAdaptive) {\n await generateRoundIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n } else {\n await deleteIconNamedAsync(projectRoot, IC_LAUNCHER_ROUND_WEBP);\n }\n await configureAdaptiveIconAsync(projectRoot, icon, backgroundImage, monochromeImage, isAdaptive);\n\n return true;\n}\n\n/**\n * Configures legacy icon files to be used on Android 7 and earlier. If adaptive icon configuration\n * was provided, we create a pseudo-adaptive icon by layering the provided files (or background\n * color if no backgroundImage is provided. If no backgroundImage and no backgroundColor are provided,\n * the background is set to transparent.)\n */\nasync function configureLegacyIconAsync(\n projectRoot: string,\n icon: string,\n backgroundImage: string | null,\n backgroundColor: string | null\n) {\n return generateMultiLayerImageAsync(projectRoot, {\n icon,\n backgroundImage,\n backgroundColor,\n outputImageFileName: IC_LAUNCHER_WEBP,\n imageCacheFolder: 'android-standard-square',\n backgroundImageCacheFolder: 'android-standard-square-background',\n });\n}\n\nasync function generateRoundIconAsync(\n projectRoot: string,\n icon: string,\n backgroundImage: string | null,\n backgroundColor: string | null\n) {\n return generateMultiLayerImageAsync(projectRoot, {\n icon,\n borderRadiusRatio: 0.5,\n outputImageFileName: IC_LAUNCHER_ROUND_WEBP,\n backgroundImage,\n backgroundColor,\n imageCacheFolder: 'android-standard-circle',\n backgroundImageCacheFolder: 'android-standard-round-background',\n isAdaptive: false,\n });\n}\n\n/**\n * Configures adaptive icon files to be used on Android 8 and up. A foreground image must be provided,\n * and will have a transparent background unless:\n * - A backgroundImage is provided, or\n * - A backgroundColor was specified\n */\nexport async function configureAdaptiveIconAsync(\n projectRoot: string,\n foregroundImage: string,\n backgroundImage: string | null,\n monochromeImage: string | null,\n isAdaptive: boolean\n) {\n if (monochromeImage) {\n await generateMonochromeImageAsync(projectRoot, {\n icon: monochromeImage,\n imageCacheFolder: 'android-adaptive-monochrome',\n outputImageFileName: IC_LAUNCHER_MONOCHROME_WEBP,\n });\n }\n await generateMultiLayerImageAsync(projectRoot, {\n backgroundColor: 'transparent',\n backgroundImage,\n backgroundImageCacheFolder: 'android-adaptive-background',\n outputImageFileName: IC_LAUNCHER_FOREGROUND_WEBP,\n icon: foregroundImage,\n imageCacheFolder: 'android-adaptive-foreground',\n backgroundImageFileName: IC_LAUNCHER_BACKGROUND_WEBP,\n isAdaptive: true,\n });\n\n // create ic_launcher.xml and ic_launcher_round.xml\n const icLauncherXmlString = createAdaptiveIconXmlString(backgroundImage, monochromeImage);\n await createAdaptiveIconXmlFiles(\n projectRoot,\n icLauncherXmlString,\n // If the user only defined icon and not android.adaptiveIcon, then skip enabling the layering system\n // this will scale the image down and present it uncropped.\n isAdaptive\n );\n}\n\nfunction setBackgroundColor(backgroundColor: string | null, colors: ResourceXML) {\n return Colors.assignColorValue(colors, {\n value: backgroundColor,\n name: ICON_BACKGROUND,\n });\n}\n\nexport const createAdaptiveIconXmlString = (\n backgroundImage: string | null,\n monochromeImage: string | null\n) => {\n const background = backgroundImage ? `@mipmap/ic_launcher_background` : `@color/iconBackground`;\n\n const iconElements: string[] = [\n `<background android:drawable=\"${background}\"/>`,\n '<foreground android:drawable=\"@mipmap/ic_launcher_foreground\"/>',\n ];\n\n if (monochromeImage) {\n iconElements.push('<monochrome android:drawable=\"@mipmap/ic_launcher_monochrome\"/>');\n }\n\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n ${iconElements.join('\\n ')}\n</adaptive-icon>`;\n};\n\nasync function createAdaptiveIconXmlFiles(\n projectRoot: string,\n icLauncherXmlString: string,\n add: boolean\n) {\n const anyDpiV26Directory = path.resolve(projectRoot, ANDROID_RES_PATH, MIPMAP_ANYDPI_V26);\n await fs.ensureDir(anyDpiV26Directory);\n const launcherPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_XML);\n const launcherRoundPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_ROUND_XML);\n if (add) {\n await Promise.all([\n fs.writeFile(launcherPath, icLauncherXmlString),\n fs.writeFile(launcherRoundPath, icLauncherXmlString),\n ]);\n } else {\n // Remove the xml if the icon switches from adaptive to standard.\n await Promise.all(\n [launcherPath, launcherRoundPath].map(async (path) => {\n if (fs.existsSync(path)) {\n return fs.remove(path);\n }\n })\n );\n }\n}\n\nasync function generateMultiLayerImageAsync(\n projectRoot: string,\n {\n icon,\n backgroundColor,\n backgroundImage,\n imageCacheFolder,\n backgroundImageCacheFolder,\n borderRadiusRatio,\n outputImageFileName,\n backgroundImageFileName,\n isAdaptive,\n }: {\n icon: string;\n backgroundImage: string | null;\n backgroundColor: string | null;\n imageCacheFolder: string;\n backgroundImageCacheFolder: string;\n backgroundImageFileName?: string;\n borderRadiusRatio?: number;\n outputImageFileName: string;\n isAdaptive?: boolean;\n }\n) {\n await iterateDpiValues(projectRoot, async ({ dpiFolder, scale }) => {\n let iconLayer = await generateIconAsync(projectRoot, {\n cacheType: imageCacheFolder,\n src: icon,\n scale,\n // backgroundImage overrides backgroundColor\n backgroundColor: backgroundImage ? 'transparent' : (backgroundColor ?? 'transparent'),\n borderRadiusRatio,\n isAdaptive,\n });\n\n if (backgroundImage) {\n const backgroundLayer = await generateIconAsync(projectRoot, {\n cacheType: backgroundImageCacheFolder,\n src: backgroundImage,\n scale,\n backgroundColor: 'transparent',\n borderRadiusRatio,\n isAdaptive,\n });\n\n if (backgroundImageFileName) {\n await fs.writeFile(path.resolve(dpiFolder, backgroundImageFileName), backgroundLayer);\n } else {\n iconLayer = await compositeImagesAsync({\n foreground: iconLayer,\n background: backgroundLayer,\n });\n }\n } else if (backgroundImageFileName) {\n // Remove any instances of ic_launcher_background.png that are there from previous icons\n await deleteIconNamedAsync(projectRoot, backgroundImageFileName);\n }\n\n await fs.ensureDir(dpiFolder);\n await fs.writeFile(path.resolve(dpiFolder, outputImageFileName), iconLayer);\n });\n}\n\nasync function generateMonochromeImageAsync(\n projectRoot: string,\n {\n icon,\n imageCacheFolder,\n outputImageFileName,\n }: { icon: string; imageCacheFolder: string; outputImageFileName: string }\n) {\n await iterateDpiValues(projectRoot, async ({ dpiFolder, scale }) => {\n const monochromeIcon = await generateIconAsync(projectRoot, {\n cacheType: imageCacheFolder,\n src: icon,\n scale,\n backgroundColor: 'transparent',\n isAdaptive: true,\n });\n await fs.ensureDir(dpiFolder);\n await fs.writeFile(path.resolve(dpiFolder, outputImageFileName), monochromeIcon);\n });\n}\n\nfunction iterateDpiValues(\n projectRoot: string,\n callback: (value: { dpiFolder: string; folderName: string; scale: number }) => Promise<void>\n) {\n return Promise.all(\n Object.values(dpiValues).map((value) =>\n callback({\n dpiFolder: path.resolve(projectRoot, ANDROID_RES_PATH, value.folderName),\n ...value,\n })\n )\n );\n}\n\nasync function deleteIconNamedAsync(projectRoot: string, name: string) {\n return iterateDpiValues(projectRoot, ({ dpiFolder }) => {\n return fs.remove(path.resolve(dpiFolder, name));\n });\n}\n\nasync function generateIconAsync(\n projectRoot: string,\n {\n cacheType,\n src,\n scale,\n backgroundColor,\n borderRadiusRatio,\n isAdaptive,\n }: {\n cacheType: string;\n src: string;\n scale: number;\n backgroundColor: string;\n borderRadiusRatio?: number;\n isAdaptive?: boolean;\n }\n) {\n const iconSizePx =\n (isAdaptive ? ADAPTIVE_BASELINE_PIXEL_SIZE : LEGACY_BASELINE_PIXEL_SIZE) * scale;\n\n return (\n await generateImageAsync(\n { projectRoot, cacheType },\n {\n src,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor,\n borderRadius: borderRadiusRatio ? iconSizePx * borderRadiusRatio : undefined,\n }\n )\n ).source;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,0BAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,yBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsE,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAA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rE,OAAOmB,gBAAgB,CAACjD,WAAW,EAAE,CAAC;IAAEkD;EAAU,CAAC,KAAK;IACtD,OAAOX,kBAAE,CAACS,MAAM,CAACX,eAAI,CAACC,OAAO,CAACY,SAAS,EAAEpB,IAAI,CAAC,CAAC;EACjD,CAAC,CAAC;AACJ;AAEA,eAAesB,iBAAiBA,CAC9BpD,WAAmB,EACnB;EACEqD,SAAS;EACTC,GAAG;EACHrF,KAAK;EACLoB,eAAe;EACfgC,iBAAiB;EACjBpB;AAQF,CAAC,EACD;EACA,MAAM6D,UAAU,GACd,CAAC7D,UAAU,GAAG1B,4BAA4B,GAAGD,0BAA0B,IAAIL,KAAK;EAElF,OAAO,CACL,MAAM,IAAA8F,gCAAkB,EACtB;IAAE/D,WAAW;IAAEqD;EAAU,CAAC,EAC1B;IACEC,GAAG;IACHU,KAAK,EAAEF,UAAU;IACjBG,MAAM,EAAEH,UAAU;IAClBI,UAAU,EAAE,OAAO;IACnB7E,eAAe;IACf8E,YAAY,EAAE9C,iBAAiB,GAAGyC,UAAU,GAAGzC,iBAAiB,GAAG+C;EACrE,CACF,CAAC,EACDC,MAAM;AACV","ignoreList":[]}
|
|
@@ -56,18 +56,19 @@ function removeImageFromSplashScreen(xml, {
|
|
|
56
56
|
debug(`Remove all splash screen image elements`);
|
|
57
57
|
removeExisting(mainView.subviews[0].imageView, IMAGE_ID);
|
|
58
58
|
|
|
59
|
-
//
|
|
59
|
+
// Remove Constraints
|
|
60
60
|
getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID).forEach(constraint => {
|
|
61
61
|
// <constraint firstItem="EXPO-SplashScreen" firstAttribute="top" secondItem="EXPO-ContainerView" secondAttribute="top" id="2VS-Uz-0LU"/>
|
|
62
62
|
const constrainsArray = mainView.constraints[0].constraint;
|
|
63
63
|
removeExisting(constrainsArray, constraint);
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
//
|
|
66
|
+
// Remove resource
|
|
67
|
+
xml.document.resources[0].image = xml.document.resources[0].image ?? [];
|
|
67
68
|
const imageSection = xml.document.resources[0].image;
|
|
68
69
|
const existingImageIndex = imageSection.findIndex(image => image.$.name === imageName);
|
|
69
|
-
if (existingImageIndex > -1) {
|
|
70
|
-
imageSection
|
|
70
|
+
if (existingImageIndex && existingImageIndex > -1) {
|
|
71
|
+
imageSection?.splice(existingImageIndex, 1);
|
|
71
72
|
}
|
|
72
73
|
return xml;
|
|
73
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InterfaceBuilder.js","names":["_crypto","data","_interopRequireDefault","require","_xml2js","e","__esModule","default","debug","createConstraint","firstItem","firstAttribute","secondItem","secondAttribute","constant","$","id","createConstraintId","attributes","crypto","createHash","update","join","digest","IMAGE_ID","CONTAINER_ID","removeImageFromSplashScreen","xml","imageName","mainView","document","scenes","scene","objects","viewController","view","removeExisting","subviews","imageView","getAbsoluteConstraints","forEach","constraint","constrainsArray","constraints","imageSection","resources","image","existingImageIndex","findIndex","name","splice","childId","parentId","legacy","applyImageToSplashScreenXML","contentMode","backgroundColor","enableFullScreenImage","imageWidth","width","height","x","rect","y","userLabel","clipsSubviews","userInteractionEnabled","translatesAutoresizingMaskIntoConstraints","key","ensureUniquePush","push","color","colorSection","namedColor","namedColorSection","parseColor","alpha","blue","rgb","green","red","customColorSpace","colorSpace","array","item","existingItem","toString","builder","Builder","preserveChildrenOrder","xmldec","version","encoding","renderOpts","pretty","indent","buildObject","toObjectAsync","contents","Parser","parseStringPromise","value","toUpperCase","replace","length","console","error","process","exit","hex","parseInt","toPrecision","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/InterfaceBuilder.ts"],"sourcesContent":["import crypto from 'crypto';\nimport { Builder, Parser } from 'xml2js';\n\nconst debug = require('debug')(\n 'expo:prebuild-config:expo-splash-screen:ios:InterfaceBuilder'\n) as typeof console.log;\n\nexport type IBBoolean = 'YES' | 'NO' | boolean;\n\nexport type IBItem<\n H extends Record<string, any>,\n B extends Record<string, any[]> = { [key: string]: any },\n> = {\n $: H;\n} & B;\n\nexport type Rect = {\n key: string;\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport type IBRect = IBItem<Rect>;\n\nexport type IBAutoresizingMask = IBItem<{\n /** @example `autoresizingMask` */\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n}>;\n\n/** @example `<color key=\"textColor\" systemColor=\"linkColor\"/>` */\nexport type IBColor = IBItem<\n {\n /** @example `textColor` */\n key: string;\n } & (\n | /** Custom color */\n {\n /** @example `0.86584504117670746` */\n red: number;\n /** @example `0.26445041990630447` */\n green: number;\n /** @example `0.3248577810203549` */\n blue: number;\n /** @example `1` */\n alpha: number;\n colorSpace: 'custom' | string;\n customColorSpace: 'displayP3' | 'sRGB' | string;\n }\n /** Built-in color */\n | {\n systemColor: 'linkColor' | string;\n }\n )\n>;\n\nexport type IBFontDescription = IBItem<{\n /** @example `fontDescription` */\n key: string;\n /** Font size */\n pointSize: number;\n\n /** Custom font */\n name?: 'HelveticaNeue' | string;\n family?: 'Helvetica Neue' | string;\n\n /** Built-in font */\n type?: 'system' | 'boldSystem' | 'UICTFontTextStyleCallout' | 'UICTFontTextStyleBody' | string;\n}>;\n\nexport type ImageContentMode = 'scaleAspectFit' | 'scaleAspectFill';\n\nexport type ConstraintAttribute = 'top' | 'bottom' | 'trailing' | 'leading' | 'centerX' | 'centerY';\n\nexport type IBImageView = IBItem<\n {\n id: string;\n userLabel: string;\n image: string;\n clipsSubviews?: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: IBContentMode;\n horizontalHuggingPriority?: number;\n verticalHuggingPriority?: number;\n insetsLayoutMarginsFromSafeArea?: IBBoolean;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n rect: IBRect[];\n }\n>;\n\nexport type IBLabel = IBItem<\n {\n id: string;\n /** The main value. */\n text: string;\n\n opaque: IBBoolean;\n fixedFrame: IBBoolean;\n textAlignment?: IBTextAlignment;\n lineBreakMode:\n | 'clip'\n | 'characterWrap'\n | 'wordWrap'\n | 'headTruncation'\n | 'middleTruncation'\n | 'tailTruncation';\n baselineAdjustment?: 'none' | 'alignBaselines';\n adjustsFontSizeToFit: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: IBContentMode;\n horizontalHuggingPriority: number;\n verticalHuggingPriority: number;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n /** @example `<rect key=\"frame\" x=\"175\" y=\"670\" width=\"35\" height=\"17\"/>` */\n rect: IBRect[];\n /** @example `<autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>` */\n autoresizingMask?: IBAutoresizingMask[];\n /** @example `<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"19\"/>` */\n fontDescription?: IBFontDescription[];\n /** @example `<color key=\"textColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>` */\n color?: IBColor[];\n nil?: IBItem<{\n /** @example `textColor` `highlightedColor` */\n key: string;\n }>[];\n }\n>;\n\nexport type IBTextAlignment = 'left' | 'center' | 'right' | 'justified' | 'natural';\n\nexport type IBContentMode = string | 'left' | 'scaleAspectFill';\n\nexport type IBConstraint = IBItem<{\n firstItem: string;\n firstAttribute: ConstraintAttribute;\n secondItem: string;\n secondAttribute: ConstraintAttribute;\n constant?: number;\n id: string;\n}>;\n\nexport type IBViewController = IBItem<\n {\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n },\n {\n view: IBItem<\n {\n id: string;\n key: string;\n userInteractionEnabled: IBBoolean;\n contentMode: string | 'scaleToFill';\n insetsLayoutMarginsFromSafeArea: IBBoolean;\n userLabel: string;\n },\n {\n rect: IBRect[];\n autoresizingMask: IBItem<{\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n }>[];\n\n subviews: IBItem<\n object,\n {\n imageView: IBImageView[];\n label: IBLabel[];\n }\n >[];\n color: IBItem<{\n key: string | 'backgroundColor';\n name?: string;\n systemColor?: string | 'systemBackgroundColor';\n red?: string;\n green?: string;\n blue?: string;\n alpha?: string;\n colorSpace?: string;\n customColorSpace?: string;\n }>[];\n constraints: IBItem<\n object,\n {\n constraint: IBConstraint[];\n }\n >[];\n viewLayoutGuide: IBItem<{\n id: string;\n key: string | 'safeArea';\n }>[];\n }\n >[];\n }\n>;\n\nexport type IBPoint = IBItem<{\n key: string | 'canvasLocation';\n x: number;\n y: number;\n}>;\n\nexport type IBScene = IBItem<\n { sceneID: string },\n {\n objects: {\n viewController: IBViewController[];\n placeholder: IBItem<{\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n }>[];\n }[];\n point: IBPoint[];\n }\n>;\n\nexport type IBResourceImage = IBItem<{\n name: string;\n width: number;\n height: number;\n}>;\n\nexport type IBResourceNamedColor = IBItem<{\n name?: string;\n systemColor?: string | 'systemBackgroundColor';\n red?: string;\n green?: string;\n blue?: string;\n alpha?: string;\n colorSpace?: string;\n customColorSpace?: string;\n}>;\n\nexport type IBDevice = IBItem<{\n id: string;\n orientation: string | 'portrait';\n appearance: string | 'light';\n}>;\n\nexport type IBSplashScreenDocument = {\n document: IBItem<\n {\n type: 'com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB' | string;\n version: '3.0' | string;\n toolsVersion: number;\n targetRuntime: 'iOS.CocoaTouch' | string;\n propertyAccessControl: 'none' | string;\n useAutolayout: IBBoolean;\n launchScreen: IBBoolean;\n useTraitCollections: IBBoolean;\n useSafeAreas: IBBoolean;\n colorMatched: IBBoolean;\n initialViewController: string;\n },\n {\n device: IBDevice[];\n dependencies: unknown[];\n scenes: {\n scene: IBScene[];\n }[];\n resources: {\n image: IBResourceImage[];\n namedColor?: IBItem<{ name: string }, { color: IBResourceNamedColor[] }>[];\n }[];\n }\n >;\n};\n\nexport function createConstraint(\n [firstItem, firstAttribute]: [string, ConstraintAttribute],\n [secondItem, secondAttribute]: [string, ConstraintAttribute],\n constant?: number\n): IBConstraint {\n return {\n $: {\n firstItem,\n firstAttribute,\n secondItem,\n secondAttribute,\n constant,\n // Prevent updating between runs\n id: createConstraintId(firstItem, firstAttribute, secondItem, secondAttribute),\n },\n };\n}\n\nexport function createConstraintId(...attributes: string[]) {\n return crypto.createHash('sha1').update(attributes.join('-')).digest('hex');\n}\n\nconst IMAGE_ID = 'EXPO-SplashScreen';\nconst CONTAINER_ID = 'EXPO-ContainerView';\n\nexport function removeImageFromSplashScreen(\n xml: IBSplashScreenDocument,\n { imageName }: { imageName: string }\n) {\n const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];\n\n debug(`Remove all splash screen image elements`);\n\n removeExisting(mainView.subviews[0].imageView, IMAGE_ID);\n\n // Add Constraints\n getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID).forEach((constraint) => {\n // <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"2VS-Uz-0LU\"/>\n const constrainsArray = mainView.constraints[0].constraint;\n removeExisting(constrainsArray, constraint);\n });\n\n // Add resource\n const imageSection = xml.document.resources[0].image;\n\n const existingImageIndex = imageSection.findIndex((image) => image.$.name === imageName);\n if (existingImageIndex > -1) {\n imageSection.splice(existingImageIndex, 1);\n }\n return xml;\n}\n\nfunction getAbsoluteConstraints(childId: string, parentId: string, legacy: boolean = false) {\n if (legacy) {\n return [\n createConstraint([childId, 'top'], [parentId, 'top']),\n createConstraint([childId, 'leading'], [parentId, 'leading']),\n createConstraint([childId, 'trailing'], [parentId, 'trailing']),\n createConstraint([childId, 'bottom'], [parentId, 'bottom']),\n ];\n }\n return [\n createConstraint([childId, 'centerX'], [parentId, 'centerX']),\n createConstraint([childId, 'centerY'], [parentId, 'centerY']),\n ];\n}\n\nexport function applyImageToSplashScreenXML(\n xml: IBSplashScreenDocument,\n {\n imageName,\n contentMode,\n backgroundColor,\n enableFullScreenImage,\n imageWidth = 100,\n }: {\n imageName: string;\n contentMode: ImageContentMode;\n backgroundColor: string;\n enableFullScreenImage: boolean;\n imageWidth?: number;\n }\n): IBSplashScreenDocument {\n const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];\n const width = enableFullScreenImage ? 414 : imageWidth;\n const height = enableFullScreenImage ? 736 : imageWidth;\n const x = enableFullScreenImage ? 0 : (mainView.rect[0].$.width - width) / 2;\n const y = enableFullScreenImage ? 0 : (mainView.rect[0].$.height - height) / 2;\n\n const imageView: IBImageView = {\n $: {\n id: IMAGE_ID,\n userLabel: imageName,\n image: imageName,\n contentMode,\n clipsSubviews: true,\n userInteractionEnabled: false,\n translatesAutoresizingMaskIntoConstraints: false,\n },\n rect: [\n {\n $: {\n key: 'frame',\n x,\n y,\n width,\n height,\n },\n },\n ],\n };\n\n // Add ImageView\n ensureUniquePush(mainView.subviews[0].imageView, imageView);\n\n mainView.constraints[0].constraint = [];\n\n // Add Constraints\n getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID, enableFullScreenImage).forEach(\n (constraint: IBConstraint) => {\n const constrainsArray = mainView.constraints[0].constraint;\n ensureUniquePush(constrainsArray, constraint);\n }\n );\n\n // Add resource\n xml.document.resources[0].image = xml.document.resources[0].image ?? [];\n const imageSection = xml.document.resources[0].image;\n\n const existingImageIndex = imageSection.findIndex((image) => image.$.name === imageName);\n if (existingImageIndex > -1) {\n debug(`Removing existing IB image asset at index ${existingImageIndex}`);\n imageSection.splice(existingImageIndex, 1);\n }\n imageSection.push({\n $: {\n name: imageName,\n width,\n height,\n },\n });\n\n // Add background color\n mainView.color = mainView.color ?? [];\n const colorSection = mainView.color;\n\n colorSection.push({\n $: {\n key: 'backgroundColor',\n name: 'SplashScreenBackground',\n },\n });\n\n // Add background named color reference\n xml.document.resources[0].namedColor = xml.document.resources[0].namedColor ?? [];\n const namedColorSection = xml.document.resources[0].namedColor;\n const color = parseColor(backgroundColor);\n\n namedColorSection.push({\n $: {\n name: 'SplashScreenBackground',\n },\n color: [\n {\n $: {\n alpha: '1.000',\n blue: color.rgb.blue,\n green: color.rgb.green,\n red: color.rgb.red,\n customColorSpace: 'sRGB',\n colorSpace: 'custom',\n },\n },\n ],\n });\n\n return xml;\n}\n\n/**\n * IB does not allow two items to have the same ID.\n * This method will add an item by first removing any existing item with the same `$.id`.\n */\nexport function ensureUniquePush<TItem extends { $: { id: string } }>(array: TItem[], item: TItem) {\n if (!array) return array;\n removeExisting(array, item);\n array.push(item);\n return array;\n}\n\nexport function removeExisting<TItem extends { $: { id: string } }>(\n array: TItem[],\n item: TItem | string\n) {\n const id = typeof item === 'string' ? item : item.$?.id;\n const existingItem = array?.findIndex((existingItem) => existingItem.$.id === id);\n if (existingItem > -1) {\n debug(`Removing existing IB item with id ${id}, from: %O`, array);\n array.splice(existingItem, 1);\n }\n return array;\n}\n\n// Attempt to copy Xcode formatting.\nexport function toString(xml: any): string {\n const builder = new Builder({\n // @ts-expect-error: untyped\n preserveChildrenOrder: true,\n xmldec: {\n version: '1.0',\n encoding: 'UTF-8',\n },\n renderOpts: {\n pretty: true,\n indent: ' ',\n },\n });\n return builder.buildObject(xml);\n}\n\n/** Parse string contents into an object. */\nexport function toObjectAsync(contents: string) {\n return new Parser().parseStringPromise(contents);\n}\n\n// Function taken from react-native-bootsplash\nexport const parseColor = (value: string): Color => {\n const color = value.toUpperCase().replace(/[^0-9A-F]/g, '');\n\n if (color.length !== 3 && color.length !== 6) {\n console.error(`\"${value}\" value is not a valid hexadecimal color.`);\n process.exit(1);\n }\n\n const hex =\n color.length === 3\n ? '#' + color[0] + color[0] + color[1] + color[1] + color[2] + color[2]\n : '#' + color;\n\n const rgb: Color['rgb'] = {\n red: (parseInt('' + hex[1] + hex[2], 16) / 255).toPrecision(15),\n green: (parseInt('' + hex[3] + hex[4], 16) / 255).toPrecision(15),\n blue: (parseInt('' + hex[5] + hex[6], 16) / 255).toPrecision(15),\n };\n\n return { hex, rgb };\n};\n\ntype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MAAM,KAAK,CAAC,IAAIjC,KAAK,CAACiC,MAAM,KAAK,CAAC,EAAE;IAC5CC,OAAO,CAACC,KAAK,CAAC,IAAIL,KAAK,2CAA2C,CAAC;IACnEM,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;EACjB;EAEA,MAAMC,GAAG,GACPtC,KAAK,CAACiC,MAAM,KAAK,CAAC,GACd,GAAG,GAAGjC,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GACrE,GAAG,GAAGA,KAAK;EAEjB,MAAMO,GAAiB,GAAG;IACxBE,GAAG,EAAE,CAAC8B,QAAQ,CAAC,EAAE,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,EAAEE,WAAW,CAAC,EAAE,CAAC;IAC/DhC,KAAK,EAAE,CAAC+B,QAAQ,CAAC,EAAE,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,EAAEE,WAAW,CAAC,EAAE,CAAC;IACjElC,IAAI,EAAE,CAACiC,QAAQ,CAAC,EAAE,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,EAAEE,WAAW,CAAC,EAAE;EACjE,CAAC;EAED,OAAO;IAAEF,GAAG;IAAE/B;EAAI,CAAC;AACrB,CAAC;AAACkC,OAAA,CAAArC,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"InterfaceBuilder.js","names":["_crypto","data","_interopRequireDefault","require","_xml2js","e","__esModule","default","debug","createConstraint","firstItem","firstAttribute","secondItem","secondAttribute","constant","$","id","createConstraintId","attributes","crypto","createHash","update","join","digest","IMAGE_ID","CONTAINER_ID","removeImageFromSplashScreen","xml","imageName","mainView","document","scenes","scene","objects","viewController","view","removeExisting","subviews","imageView","getAbsoluteConstraints","forEach","constraint","constrainsArray","constraints","resources","image","imageSection","existingImageIndex","findIndex","name","splice","childId","parentId","legacy","applyImageToSplashScreenXML","contentMode","backgroundColor","enableFullScreenImage","imageWidth","width","height","x","rect","y","userLabel","clipsSubviews","userInteractionEnabled","translatesAutoresizingMaskIntoConstraints","key","ensureUniquePush","push","color","colorSection","namedColor","namedColorSection","parseColor","alpha","blue","rgb","green","red","customColorSpace","colorSpace","array","item","existingItem","toString","builder","Builder","preserveChildrenOrder","xmldec","version","encoding","renderOpts","pretty","indent","buildObject","toObjectAsync","contents","Parser","parseStringPromise","value","toUpperCase","replace","length","console","error","process","exit","hex","parseInt","toPrecision","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/InterfaceBuilder.ts"],"sourcesContent":["import crypto from 'crypto';\nimport { Builder, Parser } from 'xml2js';\n\nconst debug = require('debug')(\n 'expo:prebuild-config:expo-splash-screen:ios:InterfaceBuilder'\n) as typeof console.log;\n\nexport type IBBoolean = 'YES' | 'NO' | boolean;\n\nexport type IBItem<\n H extends Record<string, any>,\n B extends Record<string, any[]> = { [key: string]: any },\n> = {\n $: H;\n} & B;\n\nexport type Rect = {\n key: string;\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport type IBRect = IBItem<Rect>;\n\nexport type IBAutoresizingMask = IBItem<{\n /** @example `autoresizingMask` */\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n}>;\n\n/** @example `<color key=\"textColor\" systemColor=\"linkColor\"/>` */\nexport type IBColor = IBItem<\n {\n /** @example `textColor` */\n key: string;\n } & (\n | /** Custom color */\n {\n /** @example `0.86584504117670746` */\n red: number;\n /** @example `0.26445041990630447` */\n green: number;\n /** @example `0.3248577810203549` */\n blue: number;\n /** @example `1` */\n alpha: number;\n colorSpace: 'custom' | string;\n customColorSpace: 'displayP3' | 'sRGB' | string;\n }\n /** Built-in color */\n | {\n systemColor: 'linkColor' | string;\n }\n )\n>;\n\nexport type IBFontDescription = IBItem<{\n /** @example `fontDescription` */\n key: string;\n /** Font size */\n pointSize: number;\n\n /** Custom font */\n name?: 'HelveticaNeue' | string;\n family?: 'Helvetica Neue' | string;\n\n /** Built-in font */\n type?: 'system' | 'boldSystem' | 'UICTFontTextStyleCallout' | 'UICTFontTextStyleBody' | string;\n}>;\n\nexport type ImageContentMode = 'scaleAspectFit' | 'scaleAspectFill';\n\nexport type ConstraintAttribute = 'top' | 'bottom' | 'trailing' | 'leading' | 'centerX' | 'centerY';\n\nexport type IBImageView = IBItem<\n {\n id: string;\n userLabel: string;\n image: string;\n clipsSubviews?: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: IBContentMode;\n horizontalHuggingPriority?: number;\n verticalHuggingPriority?: number;\n insetsLayoutMarginsFromSafeArea?: IBBoolean;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n rect: IBRect[];\n }\n>;\n\nexport type IBLabel = IBItem<\n {\n id: string;\n /** The main value. */\n text: string;\n\n opaque: IBBoolean;\n fixedFrame: IBBoolean;\n textAlignment?: IBTextAlignment;\n lineBreakMode:\n | 'clip'\n | 'characterWrap'\n | 'wordWrap'\n | 'headTruncation'\n | 'middleTruncation'\n | 'tailTruncation';\n baselineAdjustment?: 'none' | 'alignBaselines';\n adjustsFontSizeToFit: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: IBContentMode;\n horizontalHuggingPriority: number;\n verticalHuggingPriority: number;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n /** @example `<rect key=\"frame\" x=\"175\" y=\"670\" width=\"35\" height=\"17\"/>` */\n rect: IBRect[];\n /** @example `<autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>` */\n autoresizingMask?: IBAutoresizingMask[];\n /** @example `<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"19\"/>` */\n fontDescription?: IBFontDescription[];\n /** @example `<color key=\"textColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>` */\n color?: IBColor[];\n nil?: IBItem<{\n /** @example `textColor` `highlightedColor` */\n key: string;\n }>[];\n }\n>;\n\nexport type IBTextAlignment = 'left' | 'center' | 'right' | 'justified' | 'natural';\n\nexport type IBContentMode = string | 'left' | 'scaleAspectFill';\n\nexport type IBConstraint = IBItem<{\n firstItem: string;\n firstAttribute: ConstraintAttribute;\n secondItem: string;\n secondAttribute: ConstraintAttribute;\n constant?: number;\n id: string;\n}>;\n\nexport type IBViewController = IBItem<\n {\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n },\n {\n view: IBItem<\n {\n id: string;\n key: string;\n userInteractionEnabled: IBBoolean;\n contentMode: string | 'scaleToFill';\n insetsLayoutMarginsFromSafeArea: IBBoolean;\n userLabel: string;\n },\n {\n rect: IBRect[];\n autoresizingMask: IBItem<{\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n }>[];\n\n subviews: IBItem<\n object,\n {\n imageView: IBImageView[];\n label: IBLabel[];\n }\n >[];\n color: IBItem<{\n key: string | 'backgroundColor';\n name?: string;\n systemColor?: string | 'systemBackgroundColor';\n red?: string;\n green?: string;\n blue?: string;\n alpha?: string;\n colorSpace?: string;\n customColorSpace?: string;\n }>[];\n constraints: IBItem<\n object,\n {\n constraint: IBConstraint[];\n }\n >[];\n viewLayoutGuide: IBItem<{\n id: string;\n key: string | 'safeArea';\n }>[];\n }\n >[];\n }\n>;\n\nexport type IBPoint = IBItem<{\n key: string | 'canvasLocation';\n x: number;\n y: number;\n}>;\n\nexport type IBScene = IBItem<\n { sceneID: string },\n {\n objects: {\n viewController: IBViewController[];\n placeholder: IBItem<{\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n }>[];\n }[];\n point: IBPoint[];\n }\n>;\n\nexport type IBResourceImage = IBItem<{\n name: string;\n width: number;\n height: number;\n}>;\n\nexport type IBResourceNamedColor = IBItem<{\n name?: string;\n systemColor?: string | 'systemBackgroundColor';\n red?: string;\n green?: string;\n blue?: string;\n alpha?: string;\n colorSpace?: string;\n customColorSpace?: string;\n}>;\n\nexport type IBDevice = IBItem<{\n id: string;\n orientation: string | 'portrait';\n appearance: string | 'light';\n}>;\n\nexport type IBSplashScreenDocument = {\n document: IBItem<\n {\n type: 'com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB' | string;\n version: '3.0' | string;\n toolsVersion: number;\n targetRuntime: 'iOS.CocoaTouch' | string;\n propertyAccessControl: 'none' | string;\n useAutolayout: IBBoolean;\n launchScreen: IBBoolean;\n useTraitCollections: IBBoolean;\n useSafeAreas: IBBoolean;\n colorMatched: IBBoolean;\n initialViewController: string;\n },\n {\n device: IBDevice[];\n dependencies: unknown[];\n scenes: {\n scene: IBScene[];\n }[];\n resources: {\n image: IBResourceImage[];\n namedColor?: IBItem<{ name: string }, { color: IBResourceNamedColor[] }>[];\n }[];\n }\n >;\n};\n\nexport function createConstraint(\n [firstItem, firstAttribute]: [string, ConstraintAttribute],\n [secondItem, secondAttribute]: [string, ConstraintAttribute],\n constant?: number\n): IBConstraint {\n return {\n $: {\n firstItem,\n firstAttribute,\n secondItem,\n secondAttribute,\n constant,\n // Prevent updating between runs\n id: createConstraintId(firstItem, firstAttribute, secondItem, secondAttribute),\n },\n };\n}\n\nexport function createConstraintId(...attributes: string[]) {\n return crypto.createHash('sha1').update(attributes.join('-')).digest('hex');\n}\n\nconst IMAGE_ID = 'EXPO-SplashScreen';\nconst CONTAINER_ID = 'EXPO-ContainerView';\n\nexport function removeImageFromSplashScreen(\n xml: IBSplashScreenDocument,\n { imageName }: { imageName: string }\n) {\n const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];\n\n debug(`Remove all splash screen image elements`);\n\n removeExisting(mainView.subviews[0].imageView, IMAGE_ID);\n\n // Remove Constraints\n getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID).forEach((constraint) => {\n // <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"2VS-Uz-0LU\"/>\n const constrainsArray = mainView.constraints[0].constraint;\n removeExisting(constrainsArray, constraint);\n });\n\n // Remove resource\n xml.document.resources[0].image = xml.document.resources[0].image ?? [];\n const imageSection = xml.document.resources[0].image;\n\n const existingImageIndex = imageSection.findIndex((image) => image.$.name === imageName);\n if (existingImageIndex && existingImageIndex > -1) {\n imageSection?.splice(existingImageIndex, 1);\n }\n return xml;\n}\n\nfunction getAbsoluteConstraints(childId: string, parentId: string, legacy: boolean = false) {\n if (legacy) {\n return [\n createConstraint([childId, 'top'], [parentId, 'top']),\n createConstraint([childId, 'leading'], [parentId, 'leading']),\n createConstraint([childId, 'trailing'], [parentId, 'trailing']),\n createConstraint([childId, 'bottom'], [parentId, 'bottom']),\n ];\n }\n return [\n createConstraint([childId, 'centerX'], [parentId, 'centerX']),\n createConstraint([childId, 'centerY'], [parentId, 'centerY']),\n ];\n}\n\nexport function applyImageToSplashScreenXML(\n xml: IBSplashScreenDocument,\n {\n imageName,\n contentMode,\n backgroundColor,\n enableFullScreenImage,\n imageWidth = 100,\n }: {\n imageName: string;\n contentMode: ImageContentMode;\n backgroundColor: string;\n enableFullScreenImage: boolean;\n imageWidth?: number;\n }\n): IBSplashScreenDocument {\n const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];\n const width = enableFullScreenImage ? 414 : imageWidth;\n const height = enableFullScreenImage ? 736 : imageWidth;\n const x = enableFullScreenImage ? 0 : (mainView.rect[0].$.width - width) / 2;\n const y = enableFullScreenImage ? 0 : (mainView.rect[0].$.height - height) / 2;\n\n const imageView: IBImageView = {\n $: {\n id: IMAGE_ID,\n userLabel: imageName,\n image: imageName,\n contentMode,\n clipsSubviews: true,\n userInteractionEnabled: false,\n translatesAutoresizingMaskIntoConstraints: false,\n },\n rect: [\n {\n $: {\n key: 'frame',\n x,\n y,\n width,\n height,\n },\n },\n ],\n };\n\n // Add ImageView\n ensureUniquePush(mainView.subviews[0].imageView, imageView);\n\n mainView.constraints[0].constraint = [];\n\n // Add Constraints\n getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID, enableFullScreenImage).forEach(\n (constraint: IBConstraint) => {\n const constrainsArray = mainView.constraints[0].constraint;\n ensureUniquePush(constrainsArray, constraint);\n }\n );\n\n // Add resource\n xml.document.resources[0].image = xml.document.resources[0].image ?? [];\n const imageSection = xml.document.resources[0].image;\n\n const existingImageIndex = imageSection.findIndex((image) => image.$.name === imageName);\n if (existingImageIndex > -1) {\n debug(`Removing existing IB image asset at index ${existingImageIndex}`);\n imageSection.splice(existingImageIndex, 1);\n }\n imageSection.push({\n $: {\n name: imageName,\n width,\n height,\n },\n });\n\n // Add background color\n mainView.color = mainView.color ?? [];\n const colorSection = mainView.color;\n\n colorSection.push({\n $: {\n key: 'backgroundColor',\n name: 'SplashScreenBackground',\n },\n });\n\n // Add background named color reference\n xml.document.resources[0].namedColor = xml.document.resources[0].namedColor ?? [];\n const namedColorSection = xml.document.resources[0].namedColor;\n const color = parseColor(backgroundColor);\n\n namedColorSection.push({\n $: {\n name: 'SplashScreenBackground',\n },\n color: [\n {\n $: {\n alpha: '1.000',\n blue: color.rgb.blue,\n green: color.rgb.green,\n red: color.rgb.red,\n customColorSpace: 'sRGB',\n colorSpace: 'custom',\n },\n },\n ],\n });\n\n return xml;\n}\n\n/**\n * IB does not allow two items to have the same ID.\n * This method will add an item by first removing any existing item with the same `$.id`.\n */\nexport function ensureUniquePush<TItem extends { $: { id: string } }>(array: TItem[], item: TItem) {\n if (!array) return array;\n removeExisting(array, item);\n array.push(item);\n return array;\n}\n\nexport function removeExisting<TItem extends { $: { id: string } }>(\n array: TItem[],\n item: TItem | string\n) {\n const id = typeof item === 'string' ? item : item.$?.id;\n const existingItem = array?.findIndex((existingItem) => existingItem.$.id === id);\n if (existingItem > -1) {\n debug(`Removing existing IB item with id ${id}, from: %O`, array);\n array.splice(existingItem, 1);\n }\n return array;\n}\n\n// Attempt to copy Xcode formatting.\nexport function toString(xml: any): string {\n const builder = new Builder({\n // @ts-expect-error: untyped\n preserveChildrenOrder: true,\n xmldec: {\n version: '1.0',\n encoding: 'UTF-8',\n },\n renderOpts: {\n pretty: true,\n indent: ' ',\n },\n });\n return builder.buildObject(xml);\n}\n\n/** Parse string contents into an object. */\nexport function toObjectAsync(contents: string) {\n return new Parser().parseStringPromise(contents);\n}\n\n// Function taken from react-native-bootsplash\nexport const parseColor = (value: string): Color => {\n const color = value.toUpperCase().replace(/[^0-9A-F]/g, '');\n\n if (color.length !== 3 && color.length !== 6) {\n console.error(`\"${value}\" value is not a valid hexadecimal color.`);\n process.exit(1);\n }\n\n const hex =\n color.length === 3\n ? '#' + color[0] + color[0] + color[1] + color[1] + color[2] + color[2]\n : '#' + color;\n\n const rgb: Color['rgb'] = {\n red: (parseInt('' + hex[1] + hex[2], 16) / 255).toPrecision(15),\n green: (parseInt('' + hex[3] + hex[4], 16) / 255).toPrecision(15),\n blue: (parseInt('' + hex[5] + hex[6], 16) / 255).toPrecision(15),\n };\n\n return { hex, rgb };\n};\n\ntype Color = {\n hex: string;\n rgb: {\n red: string;\n green: string;\n blue: string;\n };\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAC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KAAK,CAACiC,MAAM,KAAK,CAAC,GACd,GAAG,GAAGjC,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,GACrE,GAAG,GAAGA,KAAK;EAEjB,MAAMO,GAAiB,GAAG;IACxBE,GAAG,EAAE,CAAC8B,QAAQ,CAAC,EAAE,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,EAAEE,WAAW,CAAC,EAAE,CAAC;IAC/DhC,KAAK,EAAE,CAAC+B,QAAQ,CAAC,EAAE,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,EAAEE,WAAW,CAAC,EAAE,CAAC;IACjElC,IAAI,EAAE,CAACiC,QAAQ,CAAC,EAAE,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAGA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,EAAEE,WAAW,CAAC,EAAE;EACjE,CAAC;EAED,OAAO;IAAEF,GAAG;IAAE/B;EAAI,CAAC;AACrB,CAAC;AAACkC,OAAA,CAAArC,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -19,7 +19,8 @@ function getAndroidSplashConfig(config, props) {
|
|
|
19
19
|
mdpi: splash.mdpi ?? splash.image,
|
|
20
20
|
backgroundColor: splash.backgroundColor,
|
|
21
21
|
resizeMode: splash.resizeMode ?? defaultResizeMode,
|
|
22
|
-
imageWidth: splash.imageWidth ?? 100
|
|
22
|
+
imageWidth: splash.imageWidth ?? 100,
|
|
23
|
+
dark: splash.dark
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
if (config.android?.splash) {
|
|
@@ -33,7 +34,8 @@ function getAndroidSplashConfig(config, props) {
|
|
|
33
34
|
backgroundColor: splash.backgroundColor,
|
|
34
35
|
image: splash.image,
|
|
35
36
|
resizeMode: splash.resizeMode ?? defaultResizeMode,
|
|
36
|
-
imageWidth: 200
|
|
37
|
+
imageWidth: 200,
|
|
38
|
+
dark: splash.dark
|
|
37
39
|
};
|
|
38
40
|
}
|
|
39
41
|
if (config.splash) {
|
|
@@ -46,7 +48,8 @@ function getAndroidSplashConfig(config, props) {
|
|
|
46
48
|
mdpi: splash.image,
|
|
47
49
|
backgroundColor: splash.backgroundColor,
|
|
48
50
|
resizeMode: splash.resizeMode ?? defaultResizeMode,
|
|
49
|
-
imageWidth: 200
|
|
51
|
+
imageWidth: 200,
|
|
52
|
+
dark: splash.dark
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
55
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAndroidSplashConfig.js","names":["defaultResizeMode","getAndroidSplashConfig","config","props","splash","xxxhdpi","image","xxhdpi","xhdpi","hdpi","mdpi","backgroundColor","resizeMode","imageWidth","
|
|
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":";;;;;;;AA2BA,MAAMA,iBAAiB,GAAG,SAAS;AAE5B,SAASC,sBAAsBA,CACpCC,MAA8C,EAC9CC,KAAkC,EACN;EAC5B;EACA;EACA,IAAIA,KAAK,EAAE;IACT,MAAMC,MAAM,GAAGD,KAAK;IACpB,OAAO;MACLE,OAAO,EAAED,MAAM,CAACC,OAAO,IAAID,MAAM,CAACE,KAAK;MACvCC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAIH,MAAM,CAACE,KAAK;MACrCE,KAAK,EAAEJ,MAAM,CAACI,KAAK,IAAIJ,MAAM,CAACE,KAAK;MACnCG,IAAI,EAAEL,MAAM,CAACK,IAAI,IAAIL,MAAM,CAACE,KAAK;MACjCI,IAAI,EAAEN,MAAM,CAACM,IAAI,IAAIN,MAAM,CAACE,KAAK;MACjCK,eAAe,EAAEP,MAAM,CAACO,eAAe;MACvCC,UAAU,EAAER,MAAM,CAACQ,UAAU,IAAIZ,iBAAiB;MAClDa,UAAU,EAAET,MAAM,CAACS,UAAU,IAAI,GAAG;MACpCC,IAA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AAI;AACb","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.16",
|
|
4
4
|
"description": "Get the prebuild config",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"expo-module-scripts": "^4.0.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@expo/config": "~10.0.
|
|
40
|
+
"@expo/config": "~10.0.4",
|
|
41
41
|
"@expo/config-plugins": "~9.0.0",
|
|
42
42
|
"@expo/config-types": "^52.0.0",
|
|
43
43
|
"@expo/image-utils": "^0.6.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "b7b95a93855cb4863b626c4524fc6e8b3a2305eb"
|
|
56
56
|
}
|