GT2/Ejectable/node_modules/@expo/configure-splash-screen/build/ios/BackgroundAsset.js.map

1 line
4.6 KiB
Plaintext

{"version":3,"file":"BackgroundAsset.js","sourceRoot":"","sources":["../../src/ios/BackgroundAsset.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0B;AAC1B,gDAAwB;AACxB,iCAA4B;AAG5B,mDAAwD;AAExD,MAAM,YAAY,GAAG,gBAAgB,CAAC;AACtC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAEhD,MAAM,aAAa,GAAG,iDAAiD,CAAC;AACxE,MAAM,aAAa,GAAG,GAAG,aAAa,gBAAgB,CAAC;AACvD,MAAM,QAAQ,GAAG,GAAG,aAAa,IAAI,YAAY,EAAE,CAAC;AACpD,MAAM,aAAa,GAAG,GAAG,aAAa,IAAI,iBAAiB,EAAE,CAAC;AAE9D,KAAK,UAAU,sBAAsB,CACnC,cAAsB,EACtB,YAAoB,EACpB,eAAwB;IAExB,MAAM,kBAAE,CAAC,MAAM,CAAC,cAAI,CAAC,OAAO,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;IAE7D,MAAM,qCAAqB,CACzB,cAAI,CAAC,OAAO,CAAC,cAAc,EAAE,aAAa,CAAC,EAC3C,YAAY,EACZ,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAChD,CAAC;IAEF,MAAM,kBAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAChC,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,QAAgB,EAAE,KAAY;IACzD,MAAM,GAAG,GAAG,IAAI,WAAG,CAAC;QAClB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,CAAC;QACZ,cAAc,EAAE,CAAC;QACjB,aAAa,EAAE,IAAI;KACpB,CAAC,CAAC;IACH,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,K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AC,CAAC;IACtF,MAAM,WAAW,CAAC,cAAc,EAAE,eAAe,EAAE,uBAAuB,CAAC,CAAC;AAC9E,CAAC;AArBD,kCAqBC","sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\nimport { PNG } from 'pngjs';\n\nimport { Color } from '../SplashScreenConfig';\nimport { writeContentsJsonFile } from './Contents.json';\n\nconst PNG_FILENAME = 'background.png';\nconst DARK_PNG_FILENAME = 'dark_background.png';\n\nconst IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';\nconst CONTENTS_PATH = `${IMAGESET_PATH}/Contents.json`;\nconst PNG_PATH = `${IMAGESET_PATH}/${PNG_FILENAME}`;\nconst DARK_PNG_PATH = `${IMAGESET_PATH}/${DARK_PNG_FILENAME}`;\n\nasync function createContentsJsonFile(\n iosProjectPath: string,\n imageSetPath: string,\n darkModeEnabled: boolean\n) {\n await fs.mkdirp(path.resolve(iosProjectPath, IMAGESET_PATH));\n\n await writeContentsJsonFile(\n path.resolve(iosProjectPath, CONTENTS_PATH),\n PNG_FILENAME,\n darkModeEnabled ? DARK_PNG_FILENAME : undefined\n );\n\n await fs.mkdirp(imageSetPath);\n}\n\nasync function createPngFile(filePath: string, color: Color) {\n const png = new PNG({\n width: 1,\n height: 1,\n bitDepth: 8,\n colorType: 6,\n inputColorType: 6,\n inputHasAlpha: true,\n });\n const [r, g, b, a] = color;\n const bitmap = new Uint8Array([r, g, b, a * 255]);\n const buffer = Buffer.from(bitmap);\n png.data = buffer;\n\n return new Promise(resolve => {\n png.pack().pipe(fs.createWriteStream(filePath)).on('finish', resolve);\n });\n}\n\nasync function createFiles(iosProjectPath: string, color: Color, darkModeColor?: Color) {\n await createPngFile(path.resolve(iosProjectPath, PNG_PATH), color);\n if (darkModeColor) {\n await createPngFile(path.resolve(iosProjectPath, DARK_PNG_PATH), darkModeColor);\n }\n}\n\n/**\n * Creates imageset containing solid color image that is used as a background for Splash Screen.\n */\nexport default async function configureAssets(\n iosProjectPath: string,\n config: {\n backgroundColor: Color;\n darkMode?: {\n backgroundColor?: Color;\n };\n }\n) {\n const backgroundColor = config.backgroundColor;\n const darkModeBackgroundColor = config.darkMode?.backgroundColor;\n\n const imageSetPath = path.resolve(iosProjectPath, IMAGESET_PATH);\n\n // ensure old SplashScreenBackground imageSet is removed\n if (await fs.pathExists(imageSetPath)) {\n await fs.remove(imageSetPath);\n }\n\n await createContentsJsonFile(iosProjectPath, imageSetPath, !!darkModeBackgroundColor);\n await createFiles(iosProjectPath, backgroundColor, darkModeBackgroundColor);\n}\n"]}