@expo/prebuild-config 8.0.13 → 8.0.15
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/unversioned/expo-splash-screen/InterfaceBuilder.js +1 -0
- 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
|
@@ -121,6 +121,7 @@ function applyImageToSplashScreenXML(xml, {
|
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
// Add resource
|
|
124
|
+
xml.document.resources[0].image = xml.document.resources[0].image ?? [];
|
|
124
125
|
const imageSection = xml.document.resources[0].image;
|
|
125
126
|
const existingImageIndex = imageSection.findIndex(image => image.$.name === imageName);
|
|
126
127
|
if (existingImageIndex > -1) {
|
|
@@ -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 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,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEzC,MAAMG,KAAK,GAAGL,OAAO,CAAC,OAAO,CAAC,CAC5B,8DACF,CAAuB;;AA4BvB;;AAuPO,SAASM,gBAAgBA,CAC9B,CAACC,SAAS,EAAEC,cAAc,CAAgC,EAC1D,CAACC,UAAU,EAAEC,eAAe,CAAgC,EAC5DC,QAAiB,EACH;EACd,OAAO;IACLC,CAAC,EAAE;MACDL,SAAS;MACTC,cAAc;MACdC,UAAU;MACVC,eAAe;MACfC,QAAQ;MACR;MACAE,EAAE,EAAEC,kBAAkB,CAACP,SAAS,EAAEC,cAAc,EAAEC,UAAU,EAAEC,eAAe;IAC/E;EACF,CAAC;AACH;AAEO,SAASI,kBAAkBA,CAAC,GAAGC,UAAoB,EAAE;EAC1D,OAAOC,iBAAM,CAACC,UAAU,CAAC,MAA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oreList":[]}
|
|
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 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,OA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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,IAAI,EAAEV,MAAM,CAACU;IACf,CAAC;EACH;EAEA,IAAIZ,MAAM,CAACa,OAAO,EAAEX,MAAM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2
2
|
"name": "@expo/prebuild-config",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.15",
|
|
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": "563c85837bc5055672846887f70f3daf5763b16d"
|
|
56
56
|
}
|