feat(smart-app): implement complete mobile app MVP

- App.tsx: full navigation (Auth stack + Main tabs with 5 screens)
- Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen
- HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors
- MapScreen: interactive map with layer toggles (6 layers)
- MarketplaceScreen: categories (6), products (5), search
- ChatScreen: AI chat with quick prompts (4), bot responses
- ProfileScreen: user info, stats, menu (9 items), logout
- AlertsScreen: alert list with severity, acknowledge
- SensorsScreen: sensor list with type filters (6 types), search
- ZonesScreen: zone cards with stats
- SettingsScreen: language picker (FR/EN/ES/DE), privacy, about
- Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n
- Hooks: useSensors, useAlerts, useNotifications, useLocation
- Components: Card, Button, LoadingSpinner, ErrorBoundary, Header
- Services: iotService, notificationService (with axios API client)
- Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN)
- Theme: colors.ts with full design system (Blue Ocean palette)
- Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
This commit is contained in:
Eric FELIXINE
2026-06-01 18:00:35 -04:00
parent 08ca495bde
commit e30ae8ed09
35578 changed files with 3703534 additions and 43 deletions

View File

@@ -0,0 +1,5 @@
import { ConfigPlugin, PluginParameters, withPlugins } from '@expo/config-plugins';
export declare function createLegacyPlugin({ packageName, fallback, }: {
packageName: string;
fallback: ConfigPlugin | PluginParameters<typeof withPlugins>;
}): ConfigPlugin;

View File

@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createLegacyPlugin = createLegacyPlugin;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
const toCamelCase = s => s.replace(/-./g, x => x.toUpperCase()[1]);
function isModuleExcluded(config, packageName) {
// Skip using the versioned plugin when autolinking is enabled
// and doesn't link the native module.
return config._internal?.autolinkedModules && !config._internal.autolinkedModules.includes(packageName);
}
function createLegacyPlugin({
packageName,
fallback
}) {
let withFallback;
if (Array.isArray(fallback)) {
withFallback = config => (0, _configPlugins().withPlugins)(config, fallback);
} else {
withFallback = fallback;
}
const withUnknown = config => {
// Skip using the versioned plugin when autolinking is enabled
// and doesn't link the native module.
if (isModuleExcluded(config, packageName)) {
return (0, _configPlugins().createRunOncePlugin)(withFallback, packageName)(config);
}
return (0, _configPlugins().withStaticPlugin)(config, {
_isLegacyPlugin: true,
plugin: packageName,
// If the static plugin isn't found, use the unversioned one.
fallback: (0, _configPlugins().createRunOncePlugin)(withFallback, packageName)
});
};
const methodName = toCamelCase(`with-${packageName}`);
Object.defineProperty(withUnknown, 'name', {
value: methodName
});
return withUnknown;
}
//# sourceMappingURL=createLegacyPlugin.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createLegacyPlugin.js","names":["_configPlugins","data","require","toCamelCase","s","replace","x","toUpperCase","isModuleExcluded","config","packageName","_internal","autolinkedModules","includes","createLegacyPlugin","fallback","withFallback","Array","isArray","withPlugins","withUnknown","createRunOncePlugin","withStaticPlugin","_isLegacyPlugin","plugin","methodName","Object","defineProperty","value"],"sources":["../../../src/plugins/unversioned/createLegacyPlugin.ts"],"sourcesContent":["import {\n ConfigPlugin,\n createRunOncePlugin,\n PluginParameters,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst toCamelCase = (s: string) => s.replace(/-./g, (x) => x.toUpperCase()[1]);\n\nfunction isModuleExcluded(config: Pick<ExpoConfig, '_internal'>, packageName: string): boolean {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n return (\n config._internal?.autolinkedModules && !config._internal.autolinkedModules.includes(packageName)\n );\n}\n\nexport function createLegacyPlugin({\n packageName,\n fallback,\n}: {\n packageName: string;\n fallback: ConfigPlugin | PluginParameters<typeof withPlugins>;\n}): ConfigPlugin {\n let withFallback: ConfigPlugin;\n\n if (Array.isArray(fallback)) {\n withFallback = (config) => withPlugins(config, fallback);\n } else {\n withFallback = fallback;\n }\n\n const withUnknown: ConfigPlugin = (config) => {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n if (isModuleExcluded(config, packageName)) {\n return createRunOncePlugin(withFallback, packageName)(config);\n }\n\n return withStaticPlugin(config, {\n _isLegacyPlugin: true,\n plugin: packageName,\n // If the static plugin isn't found, use the unversioned one.\n fallback: createRunOncePlugin(withFallback, packageName),\n });\n };\n\n const methodName = toCamelCase(`with-${packageName}`);\n Object.defineProperty(withUnknown, 'name', {\n value: methodName,\n });\n\n return withUnknown;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,MAAME,WAAW,GAAIC,CAAS,IAAKA,CAAC,CAACC,OAAO,CAAC,KAAK,EAAGC,CAAC,IAAKA,CAAC,CAACC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,SAASC,gBAAgBA,CAACC,MAAqC,EAAEC,WAAmB,EAAW;EAC7F;EACA;EACA,OACED,MAAM,CAACE,SAAS,EAAEC,iBAAiB,IAAI,CAACH,MAAM,CAACE,SAAS,CAACC,iBAAiB,CAACC,QAAQ,CAACH,WAAW,CAAC;AAEpG;AAEO,SAASI,kBAAkBA,CAAC;EACjCJ,WAAW;EACXK;AAIF,CAAC,EAAgB;EACf,IAAIC,YAA0B;EAE9B,IAAIC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,EAAE;IAC3BC,YAAY,GAAIP,MAAM,IAAK,IAAAU,4BAAW,EAACV,MAAM,EAAEM,QAAQ,CAAC;EAC1D,CAAC,MAAM;IACLC,YAAY,GAAGD,QAAQ;EACzB;EAEA,MAAMK,WAAyB,GAAIX,MAAM,IAAK;IAC5C;IACA;IACA,IAAID,gBAAgB,CAACC,MAAM,EAAEC,WAAW,CAAC,EAAE;MACzC,OAAO,IAAAW,oCAAmB,EAACL,YAAY,EAAEN,WAAW,CAAC,CAACD,MAAM,CAAC;IAC/D;IAEA,OAAO,IAAAa,iCAAgB,EAACb,MAAM,EAAE;MAC9Bc,eAAe,EAAE,IAAI;MACrBC,MAAM,EAAEd,WAAW;MACnB;MACAK,QAAQ,EAAE,IAAAM,oCAAmB,EAACL,YAAY,EAAEN,WAAW;IACzD,CAAC,CAAC;EACJ,CAAC;EAED,MAAMe,UAAU,GAAGtB,WAAW,CAAC,QAAQO,WAAW,EAAE,CAAC;EACrDgB,MAAM,CAACC,cAAc,CAACP,WAAW,EAAE,MAAM,EAAE;IACzCQ,KAAK,EAAEH;EACT,CAAC,CAAC;EAEF,OAAOL,WAAW;AACpB","ignoreList":[]}

View File

@@ -0,0 +1,2 @@
declare const _default: import("@expo/config-plugins").ConfigPlugin;
export default _default;

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _withAndroidAdMob() {
const data = require("./withAndroidAdMob");
_withAndroidAdMob = function () {
return data;
};
return data;
}
function _withIosAdMob() {
const data = require("./withIosAdMob");
_withIosAdMob = function () {
return data;
};
return data;
}
function _createLegacyPlugin() {
const data = require("../createLegacyPlugin");
_createLegacyPlugin = function () {
return data;
};
return data;
}
var _default = exports.default = (0, _createLegacyPlugin().createLegacyPlugin)({
packageName: 'expo-ads-admob',
fallback: [_withAndroidAdMob().withAndroidAdMob, _withIosAdMob().withIosAdMob]
});
//# sourceMappingURL=expo-ads-admob.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"expo-ads-admob.js","names":["_withAndroidAdMob","data","require","_withIosAdMob","_createLegacyPlugin","_default","exports","default","createLegacyPlugin","packageName","fallback","withAndroidAdMob","withIosAdMob"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/expo-ads-admob.ts"],"sourcesContent":["import { withAndroidAdMob } from './withAndroidAdMob';\nimport { withIosAdMob } from './withIosAdMob';\nimport { createLegacyPlugin } from '../createLegacyPlugin';\n\nexport default createLegacyPlugin({\n packageName: 'expo-ads-admob',\n fallback: [withAndroidAdMob, withIosAdMob],\n});\n"],"mappings":";;;;;;AAAA,SAAAA,kBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,iBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,cAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,oBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,mBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2D,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE5C,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,gBAAgB;EAC7BC,QAAQ,EAAE,CAACC,oCAAgB,EAAEC,4BAAY;AAC3C,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,6 @@
import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
export declare const withAndroidAdMob: ConfigPlugin;
export declare function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'android'>): string | null;
export declare function getGoogleMobileAdsAutoInit(config: Pick<ExpoConfig, 'android'>): boolean;
export declare function setAdMobConfig(config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidConfig.Manifest.AndroidManifest): AndroidConfig.Manifest.AndroidManifest;

View File

@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGoogleMobileAdsAppId = getGoogleMobileAdsAppId;
exports.getGoogleMobileAdsAutoInit = getGoogleMobileAdsAutoInit;
exports.setAdMobConfig = setAdMobConfig;
exports.withAndroidAdMob = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
const {
addMetaDataItemToMainApplication,
getMainApplicationOrThrow,
removeMetaDataItemFromMainApplication
} = _configPlugins().AndroidConfig.Manifest;
const META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';
const META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';
const withAndroidAdMob = config => {
return (0, _configPlugins().withAndroidManifest)(config, config => {
config.modResults = setAdMobConfig(config, config.modResults);
return config;
});
};
exports.withAndroidAdMob = withAndroidAdMob;
function getGoogleMobileAdsAppId(config) {
return config.android?.config?.googleMobileAdsAppId ?? null;
}
function getGoogleMobileAdsAutoInit(config) {
return config.android?.config?.googleMobileAdsAutoInit ?? false;
}
function setAdMobConfig(config, androidManifest) {
const appId = getGoogleMobileAdsAppId(config);
const autoInit = getGoogleMobileAdsAutoInit(config);
const mainApplication = getMainApplicationOrThrow(androidManifest);
if (appId) {
addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);
addMetaDataItemToMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT, String(!autoInit));
} else {
removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);
removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);
}
return androidManifest;
}
//# sourceMappingURL=withAndroidAdMob.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withAndroidAdMob.js","names":["_configPlugins","data","require","addMetaDataItemToMainApplication","getMainApplicationOrThrow","removeMetaDataItemFromMainApplication","AndroidConfig","Manifest","META_APPLICATION_ID","META_DELAY_APP_MEASUREMENT_INIT","withAndroidAdMob","config","withAndroidManifest","modResults","setAdMobConfig","exports","getGoogleMobileAdsAppId","android","googleMobileAdsAppId","getGoogleMobileAdsAutoInit","googleMobileAdsAutoInit","androidManifest","appId","autoInit","mainApplication","String"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withAndroidAdMob.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withAndroidManifest } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst {\n addMetaDataItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} = AndroidConfig.Manifest;\n\nconst META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';\nconst META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';\n\nexport const withAndroidAdMob: ConfigPlugin = (config) => {\n return withAndroidManifest(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function getGoogleMobileAdsAutoInit(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAutoInit ?? false;\n}\n\nexport function setAdMobConfig(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidConfig.Manifest.AndroidManifest\n) {\n const appId = getGoogleMobileAdsAppId(config);\n const autoInit = getGoogleMobileAdsAutoInit(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (appId) {\n addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DELAY_APP_MEASUREMENT_INIT,\n String(!autoInit)\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);\n removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);\n }\n\n return androidManifest;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,MAAM;EACJE,gCAAgC;EAChCC,yBAAyB;EACzBC;AACF,CAAC,GAAGC,8BAAa,CAACC,QAAQ;AAE1B,MAAMC,mBAAmB,GAAG,2CAA2C;AACvE,MAAMC,+BAA+B,GAAG,uDAAuD;AAExF,MAAMC,gBAA8B,GAAIC,MAAM,IAAK;EACxD,OAAO,IAAAC,oCAAmB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC7CA,MAAM,CAACE,UAAU,GAAGC,cAAc,CAACH,MAAM,EAAEA,MAAM,CAACE,UAAU,CAAC;IAC7D,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACI,OAAA,CAAAL,gBAAA,GAAAA,gBAAA;AAEK,SAASM,uBAAuBA,CAACL,MAAmC,EAAE;EAC3E,OAAOA,MAAM,CAACM,OAAO,EAAEN,MAAM,EAAEO,oBAAoB,IAAI,IAAI;AAC7D;AAEO,SAASC,0BAA0BA,CAACR,MAAmC,EAAE;EAC9E,OAAOA,MAAM,CAACM,OAAO,EAAEN,MAAM,EAAES,uBAAuB,IAAI,KAAK;AACjE;AAEO,SAASN,cAAcA,CAC5BH,MAAmC,EACnCU,eAAuD,EACvD;EACA,MAAMC,KAAK,GAAGN,uBAAuB,CAACL,MAAM,CAAC;EAC7C,MAAMY,QAAQ,GAAGJ,0BAA0B,CAACR,MAAM,CAAC;EACnD,MAAMa,eAAe,GAAGpB,yBAAyB,CAACiB,eAAe,CAAC;EAElE,IAAIC,KAAK,EAAE;IACTnB,gCAAgC,CAACqB,eAAe,EAAEhB,mBAAmB,EAAEc,KAAK,CAAC;IAC7EnB,gCAAgC,CAC9BqB,eAAe,EACff,+BAA+B,EAC/BgB,MAAM,CAAC,CAACF,QAAQ,CAClB,CAAC;EACH,CAAC,MAAM;IACLlB,qCAAqC,CAACmB,eAAe,EAAEhB,mBAAmB,CAAC;IAC3EH,qCAAqC,CAACmB,eAAe,EAAEf,+BAA+B,CAAC;EACzF;EAEA,OAAOY,eAAe;AACxB","ignoreList":[]}

View File

@@ -0,0 +1,5 @@
import { ConfigPlugin, InfoPlist } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
export declare const withIosAdMob: ConfigPlugin;
export declare function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'ios'>): string | null;
export declare function setGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'ios'>, { GADApplicationIdentifier, ...infoPlist }: InfoPlist): InfoPlist;

View File

@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGoogleMobileAdsAppId = getGoogleMobileAdsAppId;
exports.setGoogleMobileAdsAppId = setGoogleMobileAdsAppId;
exports.withIosAdMob = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
const withIosAdMob = config => {
return (0, _configPlugins().withInfoPlist)(config, config => {
config.modResults = setAdMobConfig(config, config.modResults);
return config;
});
};
// NOTE(brentvatne): if the developer has installed the google ads sdk and does
// not provide an app id their app will crash. Standalone apps get around this by
// providing some default value, we will instead here assume that the user can
// do the right thing if they have installed the package. This is a slight discrepancy
// that arises in ejecting because it's possible for the package to be installed and
// not crashing in the managed workflow, then you eject and the app crashes because
// you don't have an id to fall back to.
exports.withIosAdMob = withIosAdMob;
function getGoogleMobileAdsAppId(config) {
return config.ios?.config?.googleMobileAdsAppId ?? null;
}
function setGoogleMobileAdsAppId(config, {
GADApplicationIdentifier,
...infoPlist
}) {
const appId = getGoogleMobileAdsAppId(config);
if (appId === null) {
return infoPlist;
}
return {
...infoPlist,
GADApplicationIdentifier: appId
};
}
function setAdMobConfig(config, infoPlist) {
infoPlist = setGoogleMobileAdsAppId(config, infoPlist);
return infoPlist;
}
//# sourceMappingURL=withIosAdMob.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withIosAdMob.js","names":["_configPlugins","data","require","withIosAdMob","config","withInfoPlist","modResults","setAdMobConfig","exports","getGoogleMobileAdsAppId","ios","googleMobileAdsAppId","setGoogleMobileAdsAppId","GADApplicationIdentifier","infoPlist","appId"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withIosAdMob.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withIosAdMob: ConfigPlugin = (config) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\n// NOTE(brentvatne): if the developer has installed the google ads sdk and does\n// not provide an app id their app will crash. Standalone apps get around this by\n// providing some default value, we will instead here assume that the user can\n// do the right thing if they have installed the package. This is a slight discrepancy\n// that arises in ejecting because it's possible for the package to be installed and\n// not crashing in the managed workflow, then you eject and the app crashes because\n// you don't have an id to fall back to.\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function setGoogleMobileAdsAppId(\n config: Pick<ExpoConfig, 'ios'>,\n { GADApplicationIdentifier, ...infoPlist }: InfoPlist\n): InfoPlist {\n const appId = getGoogleMobileAdsAppId(config);\n\n if (appId === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GADApplicationIdentifier: appId,\n };\n}\n\nfunction setAdMobConfig(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist {\n infoPlist = setGoogleMobileAdsAppId(config, infoPlist);\n return infoPlist;\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAME,YAA0B,GAAIC,MAAM,IAAK;EACpD,OAAO,IAAAC,8BAAa,EAACD,MAAM,EAAGA,MAAM,IAAK;IACvCA,MAAM,CAACE,UAAU,GAAGC,cAAc,CAACH,MAAM,EAAEA,MAAM,CAACE,UAAU,CAAC;IAC7D,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AAAAI,OAAA,CAAAL,YAAA,GAAAA,YAAA;AACO,SAASM,uBAAuBA,CAACL,MAA+B,EAAE;EACvE,OAAOA,MAAM,CAACM,GAAG,EAAEN,MAAM,EAAEO,oBAAoB,IAAI,IAAI;AACzD;AAEO,SAASC,uBAAuBA,CACrCR,MAA+B,EAC/B;EAAES,wBAAwB;EAAE,GAAGC;AAAqB,CAAC,EAC1C;EACX,MAAMC,KAAK,GAAGN,uBAAuB,CAACL,MAAM,CAAC;EAE7C,IAAIW,KAAK,KAAK,IAAI,EAAE;IAClB,OAAOD,SAAS;EAClB;EAEA,OAAO;IACL,GAAGA,SAAS;IACZD,wBAAwB,EAAEE;EAC5B,CAAC;AACH;AAEA,SAASR,cAAcA,CAACH,MAA+B,EAAEU,SAAoB,EAAa;EACxFA,SAAS,GAAGF,uBAAuB,CAACR,MAAM,EAAEU,SAAS,CAAC;EACtD,OAAOA,SAAS;AAClB","ignoreList":[]}

View File

@@ -0,0 +1,3 @@
import { ConfigPlugin } from '@expo/config-plugins';
declare const _default: ConfigPlugin;
export default _default;

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _createLegacyPlugin() {
const data = require("./createLegacyPlugin");
_createLegacyPlugin = function () {
return data;
};
return data;
}
const withAppleSignInWarning = config => {
return (0, _configPlugins().withEntitlementsPlist)(config, config => {
if (config.ios?.usesAppleSignIn) {
_configPlugins().WarningAggregator.addWarningIOS('ios.usesAppleSignIn', 'Install expo-apple-authentication to enable this feature', 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build');
}
return config;
});
};
var _default = exports.default = (0, _createLegacyPlugin().createLegacyPlugin)({
packageName: 'expo-apple-authentication',
fallback: withAppleSignInWarning
});
//# sourceMappingURL=expo-apple-authentication.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"expo-apple-authentication.js","names":["_configPlugins","data","require","_createLegacyPlugin","withAppleSignInWarning","config","withEntitlementsPlist","ios","usesAppleSignIn","WarningAggregator","addWarningIOS","_default","exports","default","createLegacyPlugin","packageName","fallback"],"sources":["../../../src/plugins/unversioned/expo-apple-authentication.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nconst withAppleSignInWarning: ConfigPlugin = (config) => {\n return withEntitlementsPlist(config, (config) => {\n if (config.ios?.usesAppleSignIn) {\n WarningAggregator.addWarningIOS(\n 'ios.usesAppleSignIn',\n 'Install expo-apple-authentication to enable this feature',\n 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build'\n );\n }\n\n return config;\n });\n};\n\nexport default createLegacyPlugin({\n packageName: 'expo-apple-authentication',\n fallback: withAppleSignInWarning,\n});\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,sBAAoC,GAAIC,MAAM,IAAK;EACvD,OAAO,IAAAC,sCAAqB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC/C,IAAIA,MAAM,CAACE,GAAG,EAAEC,eAAe,EAAE;MAC/BC,kCAAiB,CAACC,aAAa,CAC7B,qBAAqB,EACrB,0DAA0D,EAC1D,2EACF,CAAC;IACH;IAEA,OAAOL,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,2BAA2B;EACxCC,QAAQ,EAAEZ;AACZ,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,3 @@
import { ConfigPlugin } from '@expo/config-plugins';
declare const _default: ConfigPlugin;
export default _default;

View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _createLegacyPlugin() {
const data = require("./createLegacyPlugin");
_createLegacyPlugin = function () {
return data;
};
return data;
}
const withAccessesContactNotes = config => {
return (0, _configPlugins().withEntitlementsPlist)(config, config => {
config.modResults = setAccessesContactNotes(config, config.modResults);
return config;
});
};
function setAccessesContactNotes(config, entitlementsPlist) {
if (config.ios?.accessesContactNotes) {
return {
...entitlementsPlist,
'com.apple.developer.contacts.notes': true
};
}
return entitlementsPlist;
}
var _default = exports.default = (0, _createLegacyPlugin().createLegacyPlugin)({
packageName: 'expo-contacts',
fallback: withAccessesContactNotes
});
//# sourceMappingURL=expo-contacts.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"expo-contacts.js","names":["_configPlugins","data","require","_createLegacyPlugin","withAccessesContactNotes","config","withEntitlementsPlist","modResults","setAccessesContactNotes","entitlementsPlist","ios","accessesContactNotes","_default","exports","default","createLegacyPlugin","packageName","fallback"],"sources":["../../../src/plugins/unversioned/expo-contacts.ts"],"sourcesContent":["import { ConfigPlugin, withEntitlementsPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nconst withAccessesContactNotes: ConfigPlugin = (config) => {\n return withEntitlementsPlist(config, (config) => {\n config.modResults = setAccessesContactNotes(config, config.modResults);\n return config;\n });\n};\n\nfunction setAccessesContactNotes(config: ExpoConfig, entitlementsPlist: JSONObject): JSONObject {\n if (config.ios?.accessesContactNotes) {\n return {\n ...entitlementsPlist,\n 'com.apple.developer.contacts.notes': true,\n };\n }\n\n return entitlementsPlist;\n}\n\nexport default createLegacyPlugin({\n packageName: 'expo-contacts',\n fallback: withAccessesContactNotes,\n});\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,wBAAsC,GAAIC,MAAM,IAAK;EACzD,OAAO,IAAAC,sCAAqB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC/CA,MAAM,CAACE,UAAU,GAAGC,uBAAuB,CAACH,MAAM,EAAEA,MAAM,CAACE,UAAU,CAAC;IACtE,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAED,SAASG,uBAAuBA,CAACH,MAAkB,EAAEI,iBAA6B,EAAc;EAC9F,IAAIJ,MAAM,CAACK,GAAG,EAAEC,oBAAoB,EAAE;IACpC,OAAO;MACL,GAAGF,iBAAiB;MACpB,oCAAoC,EAAE;IACxC,CAAC;EACH;EAEA,OAAOA,iBAAiB;AAC1B;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,eAAe;EAC5BC,QAAQ,EAAEb;AACZ,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,2 @@
declare const _default: import("@expo/config-plugins").ConfigPlugin;
export default _default;

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _createLegacyPlugin() {
const data = require("./createLegacyPlugin");
_createLegacyPlugin = function () {
return data;
};
return data;
}
var _default = exports.default = (0, _createLegacyPlugin().createLegacyPlugin)({
packageName: 'expo-document-picker',
fallback(config) {
if (config.ios?.usesIcloudStorage) {
_configPlugins().WarningAggregator.addWarningIOS('ios.usesIcloudStorage', 'Install expo-document-picker to enable the ios.usesIcloudStorage feature'
// TODO: add a link to a docs page with more information on how to do this
);
}
return config;
}
});
//# sourceMappingURL=expo-document-picker.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"expo-document-picker.js","names":["_configPlugins","data","require","_createLegacyPlugin","_default","exports","default","createLegacyPlugin","packageName","fallback","config","ios","usesIcloudStorage","WarningAggregator","addWarningIOS"],"sources":["../../../src/plugins/unversioned/expo-document-picker.ts"],"sourcesContent":["import { WarningAggregator } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nexport default createLegacyPlugin({\n packageName: 'expo-document-picker',\n fallback(config) {\n if (config.ios?.usesIcloudStorage) {\n WarningAggregator.addWarningIOS(\n 'ios.usesIcloudStorage',\n 'Install expo-document-picker to enable the ios.usesIcloudStorage feature'\n // TODO: add a link to a docs page with more information on how to do this\n );\n }\n return config;\n },\n});\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0D,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE3C,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,sBAAsB;EACnCC,QAAQA,CAACC,MAAM,EAAE;IACf,IAAIA,MAAM,CAACC,GAAG,EAAEC,iBAAiB,EAAE;MACjCC,kCAAiB,CAACC,aAAa,CAC7B,uBAAuB,EACvB;MACA;MACF,CAAC;IACH;IACA,OAAOJ,MAAM;EACf;AACF,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,2 @@
declare const _default: import("@expo/config-plugins").ConfigPlugin;
export default _default;

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _withAndroidNavigationBar() {
const data = require("./withAndroidNavigationBar");
_withAndroidNavigationBar = function () {
return data;
};
return data;
}
function _createLegacyPlugin() {
const data = require("../createLegacyPlugin");
_createLegacyPlugin = function () {
return data;
};
return data;
}
var _default = exports.default = (0, _createLegacyPlugin().createLegacyPlugin)({
packageName: 'expo-navigation-bar',
fallback: [
// Android
_withAndroidNavigationBar().withNavigationBar]
});
//# sourceMappingURL=expo-navigation-bar.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"expo-navigation-bar.js","names":["_withAndroidNavigationBar","data","require","_createLegacyPlugin","_default","exports","default","createLegacyPlugin","packageName","fallback","withNavigationBar"],"sources":["../../../../src/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.ts"],"sourcesContent":["import { withNavigationBar } from './withAndroidNavigationBar';\nimport { createLegacyPlugin } from '../createLegacyPlugin';\n\nexport default createLegacyPlugin({\n packageName: 'expo-navigation-bar',\n fallback: [\n // Android\n withNavigationBar,\n ],\n});\n"],"mappings":";;;;;;AAAA,SAAAA,0BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,yBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2D,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE5C,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,qBAAqB;EAClCC,QAAQ,EAAE;EACR;EACAC,6CAAiB;AAErB,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,8 @@
import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
export declare const withNavigationBar: ConfigPlugin;
export declare function setNavigationBarColors(config: Pick<ExpoConfig, 'androidNavigationBar'>, colors: AndroidConfig.Resources.ResourceXML): AndroidConfig.Resources.ResourceXML;
export declare function setNavigationBarStyles(config: Pick<ExpoConfig, 'androidNavigationBar'>, styles: AndroidConfig.Resources.ResourceXML): AndroidConfig.Resources.ResourceXML;
export declare function getNavigationBarImmersiveMode(config: Pick<ExpoConfig, 'androidNavigationBar'>): "leanback" | "immersive" | "sticky-immersive" | null;
export declare function getNavigationBarColor(config: Pick<ExpoConfig, 'androidNavigationBar'>): string | null;
export declare function getNavigationBarStyle(config: Pick<ExpoConfig, 'androidNavigationBar'>): "light-content" | "dark-content";

View File

@@ -0,0 +1,77 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getNavigationBarColor = getNavigationBarColor;
exports.getNavigationBarImmersiveMode = getNavigationBarImmersiveMode;
exports.getNavigationBarStyle = getNavigationBarStyle;
exports.setNavigationBarColors = setNavigationBarColors;
exports.setNavigationBarStyles = setNavigationBarStyles;
exports.withNavigationBar = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
const NAVIGATION_BAR_COLOR = 'navigationBarColor';
const withNavigationBar = config => {
const immersiveMode = getNavigationBarImmersiveMode(config);
if (immersiveMode) {
// Immersive mode needs to be set programmatically
_configPlugins().WarningAggregator.addWarningAndroid('androidNavigationBar.visible', 'Property is deprecated in Android 11 (API 30) and will be removed from Expo SDK.', 'https://expo.fyi/android-navigation-bar-visible-deprecated');
}
config = withNavigationBarColors(config);
config = withNavigationBarStyles(config);
return config;
};
exports.withNavigationBar = withNavigationBar;
const withNavigationBarColors = config => {
return (0, _configPlugins().withAndroidColors)(config, config => {
config.modResults = setNavigationBarColors(config, config.modResults);
return config;
});
};
const withNavigationBarStyles = config => {
return (0, _configPlugins().withAndroidStyles)(config, config => {
config.modResults = setNavigationBarStyles(config, config.modResults);
return config;
});
};
function setNavigationBarColors(config, colors) {
const hexString = getNavigationBarColor(config);
if (hexString) {
colors = _configPlugins().AndroidConfig.Colors.setColorItem(_configPlugins().AndroidConfig.Resources.buildResourceItem({
name: NAVIGATION_BAR_COLOR,
value: hexString
}), colors);
}
return colors;
}
function setNavigationBarStyles(config, styles) {
styles = _configPlugins().AndroidConfig.Styles.assignStylesValue(styles, {
add: getNavigationBarStyle(config) === 'dark-content',
parent: _configPlugins().AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(),
name: 'android:windowLightNavigationBar',
value: 'true'
});
styles = _configPlugins().AndroidConfig.Styles.assignStylesValue(styles, {
add: !!getNavigationBarColor(config),
parent: _configPlugins().AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(),
name: `android:${NAVIGATION_BAR_COLOR}`,
value: `@color/${NAVIGATION_BAR_COLOR}`
});
return styles;
}
function getNavigationBarImmersiveMode(config) {
return config.androidNavigationBar?.visible || null;
}
function getNavigationBarColor(config) {
return config.androidNavigationBar?.backgroundColor || null;
}
function getNavigationBarStyle(config) {
return config.androidNavigationBar?.barStyle || 'light-content';
}
//# sourceMappingURL=withAndroidNavigationBar.js.map

View File

@@ -0,0 +1,2 @@
declare const _default: import("@expo/config-plugins").ConfigPlugin;
export default _default;

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _withAndroidNotifications() {
const data = require("./withAndroidNotifications");
_withAndroidNotifications = function () {
return data;
};
return data;
}
function _createLegacyPlugin() {
const data = require("../createLegacyPlugin");
_createLegacyPlugin = function () {
return data;
};
return data;
}
var _default = exports.default = (0, _createLegacyPlugin().createLegacyPlugin)({
packageName: 'expo-notifications',
fallback: [
// Android
_withAndroidNotifications().withNotificationManifest, _withAndroidNotifications().withNotificationIconColor, _withAndroidNotifications().withNotificationIcons
// iOS
// Automatic setting of APNS entitlement is no longer needed
]
});
//# sourceMappingURL=expo-notifications.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"expo-notifications.js","names":["_withAndroidNotifications","data","require","_createLegacyPlugin","_default","exports","default","createLegacyPlugin","packageName","fallback","withNotificationManifest","withNotificationIconColor","withNotificationIcons"],"sources":["../../../../src/plugins/unversioned/expo-notifications/expo-notifications.ts"],"sourcesContent":["import {\n withNotificationIconColor,\n withNotificationIcons,\n withNotificationManifest,\n} from './withAndroidNotifications';\nimport { createLegacyPlugin } from '../createLegacyPlugin';\n\nexport default createLegacyPlugin({\n packageName: 'expo-notifications',\n fallback: [\n // Android\n withNotificationManifest,\n withNotificationIconColor,\n withNotificationIcons,\n // iOS\n // Automatic setting of APNS entitlement is no longer needed\n ],\n});\n"],"mappings":";;;;;;AAAA,SAAAA,0BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,yBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2D,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE5C,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,oBAAoB;EACjCC,QAAQ,EAAE;EACR;EACAC,oDAAwB,EACxBC,qDAAyB,EACzBC;EACA;EACA;EAAA;AAEJ,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,22 @@
import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
type AndroidManifest = AndroidConfig.Manifest.AndroidManifest;
export declare const META_DATA_NOTIFICATION_ICON = "expo.modules.notifications.default_notification_icon";
export declare const META_DATA_NOTIFICATION_ICON_COLOR = "expo.modules.notifications.default_notification_color";
export declare const NOTIFICATION_ICON = "notification_icon";
export declare const NOTIFICATION_ICON_RESOURCE: string;
export declare const NOTIFICATION_ICON_COLOR = "notification_icon_color";
export declare const NOTIFICATION_ICON_COLOR_RESOURCE: string;
export declare const withNotificationIcons: ConfigPlugin;
export declare const withNotificationIconColor: ConfigPlugin;
export declare const withNotificationManifest: ConfigPlugin;
export declare function getNotificationIcon(config: ExpoConfig): string | null;
export declare function getNotificationColor(config: ExpoConfig): string | null;
/**
* Applies configuration for expo-notifications, including
* the notification icon and notification color.
*/
export declare function setNotificationIconAsync(config: ExpoConfig, projectRoot: string): Promise<void>;
export declare function setNotificationConfig(config: ExpoConfig, manifest: AndroidManifest): AndroidConfig.Manifest.AndroidManifest;
export declare function setNotificationIconColor(config: ExpoConfig, colors: AndroidConfig.Resources.ResourceXML): AndroidConfig.Resources.ResourceXML;
export {};

View File

@@ -0,0 +1,161 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NOTIFICATION_ICON_RESOURCE = exports.NOTIFICATION_ICON_COLOR_RESOURCE = exports.NOTIFICATION_ICON_COLOR = exports.NOTIFICATION_ICON = exports.META_DATA_NOTIFICATION_ICON_COLOR = exports.META_DATA_NOTIFICATION_ICON = void 0;
exports.getNotificationColor = getNotificationColor;
exports.getNotificationIcon = getNotificationIcon;
exports.setNotificationConfig = setNotificationConfig;
exports.setNotificationIconAsync = setNotificationIconAsync;
exports.setNotificationIconColor = setNotificationIconColor;
exports.withNotificationManifest = exports.withNotificationIcons = exports.withNotificationIconColor = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _imageUtils() {
const data = require("@expo/image-utils");
_imageUtils = function () {
return data;
};
return data;
}
function _fsExtra() {
const data = _interopRequireDefault(require("fs-extra"));
_fsExtra = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _withAndroidIcons() {
const data = require("../../icons/withAndroidIcons");
_withAndroidIcons = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const {
Colors
} = _configPlugins().AndroidConfig;
const {
addMetaDataItemToMainApplication,
getMainApplicationOrThrow,
removeMetaDataItemFromMainApplication
} = _configPlugins().AndroidConfig.Manifest;
const BASELINE_PIXEL_SIZE = 24;
const META_DATA_NOTIFICATION_ICON = exports.META_DATA_NOTIFICATION_ICON = 'expo.modules.notifications.default_notification_icon';
const META_DATA_NOTIFICATION_ICON_COLOR = exports.META_DATA_NOTIFICATION_ICON_COLOR = 'expo.modules.notifications.default_notification_color';
const NOTIFICATION_ICON = exports.NOTIFICATION_ICON = 'notification_icon';
const NOTIFICATION_ICON_RESOURCE = exports.NOTIFICATION_ICON_RESOURCE = `@drawable/${NOTIFICATION_ICON}`;
const NOTIFICATION_ICON_COLOR = exports.NOTIFICATION_ICON_COLOR = 'notification_icon_color';
const NOTIFICATION_ICON_COLOR_RESOURCE = exports.NOTIFICATION_ICON_COLOR_RESOURCE = `@color/${NOTIFICATION_ICON_COLOR}`;
const withNotificationIcons = config => {
return (0, _configPlugins().withDangerousMod)(config, ['android', async config => {
await setNotificationIconAsync(config, config.modRequest.projectRoot);
return config;
}]);
};
exports.withNotificationIcons = withNotificationIcons;
const withNotificationIconColor = config => {
return (0, _configPlugins().withAndroidColors)(config, config => {
config.modResults = setNotificationIconColor(config, config.modResults);
return config;
});
};
exports.withNotificationIconColor = withNotificationIconColor;
const withNotificationManifest = config => {
return (0, _configPlugins().withAndroidManifest)(config, config => {
config.modResults = setNotificationConfig(config, config.modResults);
return config;
});
};
exports.withNotificationManifest = withNotificationManifest;
function getNotificationIcon(config) {
return config.notification?.icon || null;
}
function getNotificationColor(config) {
return config.notification?.color || null;
}
/**
* Applies configuration for expo-notifications, including
* the notification icon and notification color.
*/
async function setNotificationIconAsync(config, projectRoot) {
const icon = getNotificationIcon(config);
if (icon) {
await writeNotificationIconImageFilesAsync(icon, projectRoot);
} else {
await removeNotificationIconImageFilesAsync(projectRoot);
}
}
function setNotificationConfig(config, manifest) {
const icon = getNotificationIcon(config);
const color = getNotificationColor(config);
const mainApplication = getMainApplicationOrThrow(manifest);
if (icon) {
addMetaDataItemToMainApplication(mainApplication, META_DATA_NOTIFICATION_ICON, NOTIFICATION_ICON_RESOURCE, 'resource');
} else {
removeMetaDataItemFromMainApplication(mainApplication, META_DATA_NOTIFICATION_ICON);
}
if (color) {
addMetaDataItemToMainApplication(mainApplication, META_DATA_NOTIFICATION_ICON_COLOR, NOTIFICATION_ICON_COLOR_RESOURCE, 'resource');
} else {
removeMetaDataItemFromMainApplication(mainApplication, META_DATA_NOTIFICATION_ICON_COLOR);
}
return manifest;
}
function setNotificationIconColor(config, colors) {
return Colors.assignColorValue(colors, {
name: NOTIFICATION_ICON_COLOR,
value: getNotificationColor(config)
});
}
async function writeNotificationIconImageFilesAsync(icon, projectRoot) {
await Promise.all(Object.values(_withAndroidIcons().dpiValues).map(async ({
folderName,
scale
}) => {
const drawableFolderName = folderName.replace('mipmap', 'drawable');
const dpiFolderPath = _path().default.resolve(projectRoot, _withAndroidIcons().ANDROID_RES_PATH, drawableFolderName);
await _fsExtra().default.ensureDir(dpiFolderPath);
const iconSizePx = BASELINE_PIXEL_SIZE * scale;
try {
const resizedIcon = (await (0, _imageUtils().generateImageAsync)({
projectRoot,
cacheType: 'android-notification'
}, {
src: icon,
width: iconSizePx,
height: iconSizePx,
resizeMode: 'cover',
backgroundColor: 'transparent'
})).source;
await _fsExtra().default.writeFile(_path().default.resolve(dpiFolderPath, NOTIFICATION_ICON + '.png'), resizedIcon);
} catch (e) {
throw new Error('Encountered an issue resizing Android notification icon: ' + e);
}
}));
}
async function removeNotificationIconImageFilesAsync(projectRoot) {
await Promise.all(Object.values(_withAndroidIcons().dpiValues).map(async ({
folderName
}) => {
const drawableFolderName = folderName.replace('mipmap', 'drawable');
const dpiFolderPath = _path().default.resolve(projectRoot, _withAndroidIcons().ANDROID_RES_PATH, drawableFolderName);
await _fsExtra().default.remove(_path().default.resolve(dpiFolderPath, NOTIFICATION_ICON + '.png'));
}));
}
//# sourceMappingURL=withAndroidNotifications.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,222 @@
export type IBBoolean = 'YES' | 'NO' | boolean;
export type IBItem<H extends Record<string, any>, B extends Record<string, any[]> = {
[key: string]: any;
}> = {
$: H;
} & B;
export type Rect = {
key: string;
x: number;
y: number;
width: number;
height: number;
};
export type IBRect = IBItem<Rect>;
export type IBAutoresizingMask = IBItem<{
/** @example `autoresizingMask` */
key: string;
flexibleMaxX: IBBoolean;
flexibleMaxY: IBBoolean;
}>;
/** @example `<color key="textColor" systemColor="linkColor"/>` */
export type IBColor = IBItem<{
/** @example `textColor` */
key: string;
} & (/** Custom color */ {
/** @example `0.86584504117670746` */
red: number;
/** @example `0.26445041990630447` */
green: number;
/** @example `0.3248577810203549` */
blue: number;
/** @example `1` */
alpha: number;
colorSpace: 'custom' | string;
customColorSpace: 'displayP3' | 'sRGB' | string;
}
/** Built-in color */
| {
systemColor: 'linkColor' | string;
})>;
export type IBFontDescription = IBItem<{
/** @example `fontDescription` */
key: string;
/** Font size */
pointSize: number;
/** Custom font */
name?: 'HelveticaNeue' | string;
family?: 'Helvetica Neue' | string;
/** Built-in font */
type?: 'system' | 'boldSystem' | 'UICTFontTextStyleCallout' | 'UICTFontTextStyleBody' | string;
}>;
export type ImageContentMode = 'scaleAspectFit' | 'scaleAspectFill';
export type ConstraintAttribute = 'top' | 'bottom' | 'trailing' | 'leading';
export type IBImageView = IBItem<{
id: string;
userLabel: string;
image: string;
clipsSubviews?: IBBoolean;
userInteractionEnabled: IBBoolean;
contentMode: IBContentMode;
horizontalHuggingPriority: number;
verticalHuggingPriority: number;
insetsLayoutMarginsFromSafeArea?: IBBoolean;
translatesAutoresizingMaskIntoConstraints?: IBBoolean;
}, {
rect: IBRect[];
}>;
export type IBLabel = IBItem<{
id: string;
/** The main value. */
text: string;
opaque: IBBoolean;
fixedFrame: IBBoolean;
textAlignment?: IBTextAlignment;
lineBreakMode: 'clip' | 'characterWrap' | 'wordWrap' | 'headTruncation' | 'middleTruncation' | 'tailTruncation';
baselineAdjustment?: 'none' | 'alignBaselines';
adjustsFontSizeToFit: IBBoolean;
userInteractionEnabled: IBBoolean;
contentMode: IBContentMode;
horizontalHuggingPriority: number;
verticalHuggingPriority: number;
translatesAutoresizingMaskIntoConstraints?: IBBoolean;
}, {
/** @example `<rect key="frame" x="175" y="670" width="35" height="17"/>` */
rect: IBRect[];
/** @example `<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>` */
autoresizingMask?: IBAutoresizingMask[];
/** @example `<fontDescription key="fontDescription" type="system" pointSize="19"/>` */
fontDescription?: IBFontDescription[];
/** @example `<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>` */
color?: IBColor[];
nil?: IBItem<{
/** @example `textColor` `highlightedColor` */
key: string;
}>[];
}>;
export type IBTextAlignment = 'left' | 'center' | 'right' | 'justified' | 'natural';
export type IBContentMode = string | 'left' | 'scaleAspectFill';
export type IBConstraint = IBItem<{
firstItem: string;
firstAttribute: ConstraintAttribute;
secondItem: string;
secondAttribute: ConstraintAttribute;
constant?: number;
id: string;
}>;
export type IBViewController = IBItem<{
id: string;
placeholderIdentifier?: string;
userLabel: string;
sceneMemberID: string;
}, {
view: IBItem<{
id: string;
key: string;
userInteractionEnabled: IBBoolean;
contentMode: string | 'scaleToFill';
insetsLayoutMarginsFromSafeArea: IBBoolean;
userLabel: string;
}, {
rect: IBRect[];
autoresizingMask: IBItem<{
key: string;
flexibleMaxX: IBBoolean;
flexibleMaxY: IBBoolean;
}>[];
subviews: IBItem<object, {
imageView: IBImageView[];
label: IBLabel[];
}>[];
color: IBItem<{
key: string | 'backgroundColor';
systemColor: string | 'systemBackgroundColor';
}>[];
constraints: IBItem<object, {
constraint: IBConstraint[];
}>[];
viewLayoutGuide: IBItem<{
id: string;
key: string | 'safeArea';
}>[];
}>[];
}>;
export type IBPoint = IBItem<{
key: string | 'canvasLocation';
x: number;
y: number;
}>;
export type IBScene = IBItem<{
sceneID: string;
}, {
objects: {
viewController: IBViewController[];
placeholder: IBItem<{
id: string;
placeholderIdentifier?: string;
userLabel: string;
sceneMemberID: string;
}>[];
}[];
point: IBPoint[];
}>;
export type IBResourceImage = IBItem<{
name: string;
width: number;
height: number;
}>;
export type IBDevice = IBItem<{
id: string;
orientation: string | 'portrait';
appearance: string | 'light';
}>;
export type IBSplashScreenDocument = {
document: IBItem<{
type: 'com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB' | string;
version: '3.0' | string;
toolsVersion: number;
targetRuntime: 'iOS.CocoaTouch' | string;
propertyAccessControl: 'none' | string;
useAutolayout: IBBoolean;
launchScreen: IBBoolean;
useTraitCollections: IBBoolean;
useSafeAreas: IBBoolean;
colorMatched: IBBoolean;
initialViewController: string;
}, {
device: IBDevice[];
dependencies: unknown[];
scenes: {
scene: IBScene[];
}[];
resources: {
image: IBResourceImage[];
}[];
}>;
};
export declare function createConstraint([firstItem, firstAttribute]: [string, ConstraintAttribute], [secondItem, secondAttribute]: [string, ConstraintAttribute], constant?: number): IBConstraint;
export declare function createConstraintId(...attributes: string[]): string;
export declare function removeImageFromSplashScreen(xml: IBSplashScreenDocument, { imageName }: {
imageName: string;
}): IBSplashScreenDocument;
export declare function applyImageToSplashScreenXML(xml: IBSplashScreenDocument, { imageName, contentMode, }: {
imageName: string;
contentMode: ImageContentMode;
}): IBSplashScreenDocument;
/**
* IB does not allow two items to have the same ID.
* This method will add an item by first removing any existing item with the same `$.id`.
*/
export declare function ensureUniquePush<TItem extends {
$: {
id: string;
};
}>(array: TItem[], item: TItem): TItem[];
export declare function removeExisting<TItem extends {
$: {
id: string;
};
}>(array: TItem[], item: TItem | string): TItem[];
export declare function toString(xml: any): string;
/** Parse string contents into an object. */
export declare function toObjectAsync(contents: string): Promise<any>;

View File

@@ -0,0 +1,175 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.applyImageToSplashScreenXML = applyImageToSplashScreenXML;
exports.createConstraint = createConstraint;
exports.createConstraintId = createConstraintId;
exports.ensureUniquePush = ensureUniquePush;
exports.removeExisting = removeExisting;
exports.removeImageFromSplashScreen = removeImageFromSplashScreen;
exports.toObjectAsync = toObjectAsync;
exports.toString = toString;
function _crypto() {
const data = _interopRequireDefault(require("crypto"));
_crypto = function () {
return data;
};
return data;
}
function _xml2js() {
const data = require("xml2js");
_xml2js = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const debug = require('debug')('expo:prebuild-config:expo-splash-screen:ios:InterfaceBuilder');
/** @example `<color key="textColor" systemColor="linkColor"/>` */
function createConstraint([firstItem, firstAttribute], [secondItem, secondAttribute], constant) {
return {
$: {
firstItem,
firstAttribute,
secondItem,
secondAttribute,
constant,
// Prevent updating between runs
id: createConstraintId(firstItem, firstAttribute, secondItem, secondAttribute)
}
};
}
function createConstraintId(...attributes) {
return _crypto().default.createHash('sha1').update(attributes.join('-')).digest('hex');
}
const IMAGE_ID = 'EXPO-SplashScreen';
const CONTAINER_ID = 'EXPO-ContainerView';
function removeImageFromSplashScreen(xml, {
imageName
}) {
const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];
debug(`Remove all splash screen image elements`);
removeExisting(mainView.subviews[0].imageView, IMAGE_ID);
// Add Constraints
getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID).forEach(constraint => {
// <constraint firstItem="EXPO-SplashScreen" firstAttribute="top" secondItem="EXPO-ContainerView" secondAttribute="top" id="2VS-Uz-0LU"/>
const constrainsArray = mainView.constraints[0].constraint;
removeExisting(constrainsArray, constraint);
});
// Add resource
const imageSection = xml.document.resources[0].image;
const existingImageIndex = imageSection.findIndex(image => image.$.name === imageName);
if (existingImageIndex > -1) {
imageSection.splice(existingImageIndex, 1);
}
return xml;
}
function getAbsoluteConstraints(childId, parentId) {
return [createConstraint([childId, 'top'], [parentId, 'top']), createConstraint([childId, 'leading'], [parentId, 'leading']), createConstraint([childId, 'trailing'], [parentId, 'trailing']), createConstraint([childId, 'bottom'], [parentId, 'bottom'])];
}
function applyImageToSplashScreenXML(xml, {
imageName,
contentMode
}) {
const width = 414;
const height = 736;
const imageView = {
$: {
id: IMAGE_ID,
userLabel: imageName,
image: imageName,
contentMode,
horizontalHuggingPriority: 251,
verticalHuggingPriority: 251,
clipsSubviews: true,
userInteractionEnabled: false,
translatesAutoresizingMaskIntoConstraints: false
},
rect: [{
$: {
key: 'frame',
x: 0.0,
y: 0.0,
width,
height
}
}]
};
const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];
// Add ImageView
ensureUniquePush(mainView.subviews[0].imageView, imageView);
// Add Constraints
getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID).forEach(constraint => {
// <constraint firstItem="EXPO-SplashScreen" firstAttribute="top" secondItem="EXPO-ContainerView" secondAttribute="top" id="2VS-Uz-0LU"/>
const constrainsArray = mainView.constraints[0].constraint;
ensureUniquePush(constrainsArray, constraint);
});
// Add resource
const imageSection = xml.document.resources[0].image;
const existingImageIndex = imageSection.findIndex(image => image.$.name === imageName);
if (existingImageIndex > -1) {
debug(`Removing existing IB image asset at index ${existingImageIndex}`);
imageSection.splice(existingImageIndex, 1);
}
imageSection.push({
// <image name="SplashScreen" width="414" height="736"/>
$: {
name: imageName,
width,
height
}
});
return xml;
}
/**
* IB does not allow two items to have the same ID.
* This method will add an item by first removing any existing item with the same `$.id`.
*/
function ensureUniquePush(array, item) {
if (!array) return array;
removeExisting(array, item);
array.push(item);
return array;
}
function removeExisting(array, item) {
const id = typeof item === 'string' ? item : item.$?.id;
const existingItem = array?.findIndex(existingItem => existingItem.$.id === id);
if (existingItem > -1) {
debug(`Removing existing IB item with id ${id}, from: %O`, array);
array.splice(existingItem, 1);
}
return array;
}
// Attempt to copy Xcode formatting.
function toString(xml) {
const builder = new (_xml2js().Builder)({
// @ts-expect-error: untyped
preserveChildrenOrder: true,
xmldec: {
version: '1.0',
encoding: 'UTF-8'
},
renderOpts: {
pretty: true,
indent: ' '
}
});
return builder.buildObject(xml);
}
/** Parse string contents into an object. */
function toObjectAsync(contents) {
return new (_xml2js().Parser)().parseStringPromise(contents);
}
//# sourceMappingURL=InterfaceBuilder.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
declare const _default: import("@expo/config-plugins").ConfigPlugin;
export default _default;

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _withAndroidSplashScreen() {
const data = require("./withAndroidSplashScreen");
_withAndroidSplashScreen = function () {
return data;
};
return data;
}
function _withIosSplashScreen() {
const data = require("./withIosSplashScreen");
_withIosSplashScreen = function () {
return data;
};
return data;
}
function _createLegacyPlugin() {
const data = require("../createLegacyPlugin");
_createLegacyPlugin = function () {
return data;
};
return data;
}
var _default = exports.default = (0, _createLegacyPlugin().createLegacyPlugin)({
packageName: 'expo-splash-screen',
fallback: [_withAndroidSplashScreen().withAndroidSplashScreen, _withIosSplashScreen().withIosSplashScreen]
});
//# sourceMappingURL=expo-splash-screen.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"expo-splash-screen.js","names":["_withAndroidSplashScreen","data","require","_withIosSplashScreen","_createLegacyPlugin","_default","exports","default","createLegacyPlugin","packageName","fallback","withAndroidSplashScreen","withIosSplashScreen"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/expo-splash-screen.ts"],"sourcesContent":["import { withAndroidSplashScreen } from './withAndroidSplashScreen';\nimport { withIosSplashScreen } from './withIosSplashScreen';\nimport { createLegacyPlugin } from '../createLegacyPlugin';\n\nexport default createLegacyPlugin({\n packageName: 'expo-splash-screen',\n fallback: [withAndroidSplashScreen, withIosSplashScreen],\n});\n"],"mappings":";;;;;;AAAA,SAAAA,yBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,wBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,qBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,oBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,oBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,mBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2D,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE5C,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,oBAAoB;EACjCC,QAAQ,EAAE,CAACC,kDAAuB,EAAEC,0CAAmB;AACzD,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,12 @@
import { ExpoConfig } from '@expo/config-types';
export type SplashScreenConfig = {
xxxhdpi: string | null;
xxhdpi: string | null;
xhdpi: string | null;
hdpi: string | null;
mdpi: string | null;
backgroundColor: string | null;
resizeMode: 'contain' | 'cover' | 'native';
};
export declare function getAndroidSplashConfig(config: Pick<ExpoConfig, 'splash' | 'android'>): SplashScreenConfig | null;
export declare function getAndroidDarkSplashConfig(config: Pick<ExpoConfig, 'splash' | 'android'>): SplashScreenConfig | null;

View File

@@ -0,0 +1,57 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAndroidDarkSplashConfig = getAndroidDarkSplashConfig;
exports.getAndroidSplashConfig = getAndroidSplashConfig;
const defaultResizeMode = 'contain';
function getAndroidSplashConfig(config) {
// Respect the splash screen object, don't mix and match across different splash screen objects
// in case the user wants the top level splash to apply to every platform except android.
if (config.android?.splash) {
const splash = config.android?.splash;
return {
xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,
xxhdpi: splash.xxhdpi ?? splash.image ?? null,
xhdpi: splash.xhdpi ?? splash.image ?? null,
hdpi: splash.hdpi ?? splash.image ?? null,
mdpi: splash.mdpi ?? splash.image ?? null,
backgroundColor: splash.backgroundColor ?? null,
resizeMode: splash.resizeMode ?? defaultResizeMode
};
}
if (config.splash) {
const splash = config.splash;
return {
xxxhdpi: splash.image ?? null,
xxhdpi: splash.image ?? null,
xhdpi: splash.image ?? null,
hdpi: splash.image ?? null,
mdpi: splash.image ?? null,
backgroundColor: splash.backgroundColor ?? null,
resizeMode: splash.resizeMode ?? defaultResizeMode
};
}
return null;
}
function getAndroidDarkSplashConfig(config) {
// Respect the splash screen object, don't mix and match across different splash screen objects
// in case the user wants the top level splash to apply to every platform except android.
if (config.android?.splash?.dark) {
const splash = config.android?.splash?.dark;
const lightTheme = getAndroidSplashConfig(config);
return {
xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,
xxhdpi: splash.xxhdpi ?? splash.image ?? null,
xhdpi: splash.xhdpi ?? splash.image ?? null,
hdpi: splash.hdpi ?? splash.image ?? null,
mdpi: splash.mdpi ?? splash.image ?? null,
backgroundColor: splash.backgroundColor ?? null,
// Can't support dark resizeMode because the resize mode is hardcoded into the MainActivity.java
resizeMode: lightTheme?.resizeMode ?? defaultResizeMode
};
}
return null;
}
//# sourceMappingURL=getAndroidSplashConfig.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getAndroidSplashConfig.js","names":["defaultResizeMode","getAndroidSplashConfig","config","android","splash","xxxhdpi","image","xxhdpi","xhdpi","hdpi","mdpi","backgroundColor","resizeMode","getAndroidDarkSplashConfig","dark","lightTheme"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nexport type SplashScreenConfig = {\n xxxhdpi: string | null;\n xxhdpi: string | null;\n xhdpi: string | null;\n hdpi: string | null;\n mdpi: string | null;\n backgroundColor: string | null;\n resizeMode: 'contain' | 'cover' | 'native';\n};\n\nconst defaultResizeMode = 'contain';\n\nexport function getAndroidSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>\n): SplashScreenConfig | 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 (config.android?.splash) {\n const splash = config.android?.splash;\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,\n xxhdpi: splash.xxhdpi ?? splash.image ?? null,\n xhdpi: splash.xhdpi ?? splash.image ?? null,\n hdpi: splash.hdpi ?? splash.image ?? null,\n mdpi: splash.mdpi ?? splash.image ?? null,\n backgroundColor: splash.backgroundColor ?? null,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n return {\n xxxhdpi: splash.image ?? null,\n xxhdpi: splash.image ?? null,\n xhdpi: splash.image ?? null,\n hdpi: splash.image ?? null,\n mdpi: splash.image ?? null,\n backgroundColor: splash.backgroundColor ?? null,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n };\n }\n\n return null;\n}\n\nexport function getAndroidDarkSplashConfig(\n config: Pick<ExpoConfig, 'splash' | 'android'>\n): SplashScreenConfig | 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 (config.android?.splash?.dark) {\n const splash = config.android?.splash?.dark;\n const lightTheme = getAndroidSplashConfig(config);\n return {\n xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,\n xxhdpi: splash.xxhdpi ?? splash.image ?? null,\n xhdpi: splash.xhdpi ?? splash.image ?? null,\n hdpi: splash.hdpi ?? splash.image ?? null,\n mdpi: splash.mdpi ?? splash.image ?? null,\n backgroundColor: splash.backgroundColor ?? null,\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":";;;;;;;AAYA,MAAMA,iBAAiB,GAAG,SAAS;AAE5B,SAASC,sBAAsBA,CACpCC,MAA8C,EACnB;EAC3B;EACA;EACA,IAAIA,MAAM,CAACC,OAAO,EAAEC,MAAM,EAAE;IAC1B,MAAMA,MAAM,GAAGF,MAAM,CAACC,OAAO,EAAEC,MAAM;IACrC,OAAO;MACLC,OAAO,EAAED,MAAM,CAACC,OAAO,IAAID,MAAM,CAACE,KAAK,IAAI,IAAI;MAC/CC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAIH,MAAM,CAACE,KAAK,IAAI,IAAI;MAC7CE,KAAK,EAAEJ,MAAM,CAACI,KAAK,IAAIJ,MAAM,CAACE,KAAK,IAAI,IAAI;MAC3CG,IAAI,EAAEL,MAAM,CAACK,IAAI,IAAIL,MAAM,CAACE,KAAK,IAAI,IAAI;MACzCI,IAAI,EAAEN,MAAM,CAACM,IAAI,IAAIN,MAAM,CAACE,KAAK,IAAI,IAAI;MACzCK,eAAe,EAAEP,MAAM,CAACO,eAAe,IAAI,IAAI;MAC/CC,UAAU,EAAER,MAAM,CAACQ,UAAU,IAAIZ;IACnC,CAAC;EACH;EAEA,IAAIE,MAAM,CAACE,MAAM,EAAE;IACjB,MAAMA,MAAM,GAAGF,MAAM,CAACE,MAAM;IAC5B,OAAO;MACLC,OAAO,EAAED,MAAM,CAACE,KAAK,IAAI,IAAI;MAC7BC,MAAM,EAAEH,MAAM,CAACE,KAAK,IAAI,IAAI;MAC5BE,KAAK,EAAEJ,MAAM,CAACE,KAAK,IAAI,IAAI;MAC3BG,IAAI,EAAEL,MAAM,CAACE,KAAK,IAAI,IAAI;MAC1BI,IAAI,EAAEN,MAAM,CAACE,KAAK,IAAI,IAAI;MAC1BK,eAAe,EAAEP,MAAM,CAACO,eAAe,IAAI,IAAI;MAC/CC,UAAU,EAAER,MAAM,CAACQ,UAAU,IAAIZ;IACnC,CAAC;EACH;EAEA,OAAO,IAAI;AACb;AAEO,SAASa,0BAA0BA,CACxCX,MAA8C,EACnB;EAC3B;EACA;EACA,IAAIA,MAAM,CAACC,OAAO,EAAEC,MAAM,EAAEU,IAAI,EAAE;IAChC,MAAMV,MAAM,GAAGF,MAAM,CAACC,OAAO,EAAEC,MAAM,EAAEU,IAAI;IAC3C,MAAMC,UAAU,GAAGd,sBAAsB,CAACC,MAAM,CAAC;IACjD,OAAO;MACLG,OAAO,EAAED,MAAM,CAACC,OAAO,IAAID,MAAM,CAACE,KAAK,IAAI,IAAI;MAC/CC,MAAM,EAAEH,MAAM,CAACG,MAAM,IAAIH,MAAM,CAACE,KAAK,IAAI,IAAI;MAC7CE,KAAK,EAAEJ,MAAM,CAACI,KAAK,IAAIJ,MAAM,CAACE,KAAK,IAAI,IAAI;MAC3CG,IAAI,EAAEL,MAAM,CAACK,IAAI,IAAIL,MAAM,CAACE,KAAK,IAAI,IAAI;MACzCI,IAAI,EAAEN,MAAM,CAACM,IAAI,IAAIN,MAAM,CAACE,KAAK,IAAI,IAAI;MACzCK,eAAe,EAAEP,MAAM,CAACO,eAAe,IAAI,IAAI;MAC/C;MACAC,UAAU,EAAEG,UAAU,EAAEH,UAAU,IAAIZ;IACxC,CAAC;EACH;EAEA,OAAO,IAAI;AACb","ignoreList":[]}

View File

@@ -0,0 +1,17 @@
import { ExpoConfig } from '@expo/config-types';
type ExpoConfigIosSplash = NonNullable<NonNullable<ExpoConfig['ios']>['splash']>;
export interface IOSSplashConfig {
image?: string | null;
backgroundColor: string;
resizeMode: NonNullable<ExpoConfigIosSplash['resizeMode']>;
tabletImage: string | null;
tabletBackgroundColor: string | null;
dark?: {
image?: string | null;
backgroundColor?: string | null;
tabletImage?: string | null;
tabletBackgroundColor?: string | null;
};
}
export declare function getIosSplashConfig(config: ExpoConfig): IOSSplashConfig | null;
export {};

View File

@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getIosSplashConfig = getIosSplashConfig;
const defaultResizeMode = 'contain';
const defaultBackgroundColor = '#ffffff';
// TODO: Maybe use an array on splash with theme value. Then remove the array in serialization for legacy and manifest.
function getIosSplashConfig(config) {
// Respect the splash screen object, don't mix and match across different splash screen objects
// in case the user wants the top level splash to apply to every platform except iOS.
if (config.ios?.splash) {
const splash = config.ios?.splash;
const image = splash.image ?? null;
return {
image,
resizeMode: splash.resizeMode ?? defaultResizeMode,
backgroundColor: splash.backgroundColor ?? defaultBackgroundColor,
tabletImage: splash.tabletImage ?? null,
tabletBackgroundColor: splash.tabletBackgroundColor,
dark: {
image: splash.dark?.image ?? null,
backgroundColor: splash.dark?.backgroundColor,
tabletImage: splash.dark?.tabletImage ?? null,
tabletBackgroundColor: splash.dark?.tabletBackgroundColor
}
};
}
if (config.splash) {
const splash = config.splash;
const image = splash.image ?? null;
return {
image,
resizeMode: splash.resizeMode ?? defaultResizeMode,
backgroundColor: splash.backgroundColor ?? defaultBackgroundColor,
tabletImage: null,
tabletBackgroundColor: null,
dark: {
image: null,
backgroundColor: null,
tabletImage: null,
tabletBackgroundColor: null
}
};
}
return {
backgroundColor: '#ffffff',
resizeMode: 'contain',
tabletImage: null,
tabletBackgroundColor: null
};
}
//# sourceMappingURL=getIosSplashConfig.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getIosSplashConfig.js","names":["defaultResizeMode","defaultBackgroundColor","getIosSplashConfig","config","ios","splash","image","resizeMode","backgroundColor","tabletImage","tabletBackgroundColor","dark"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/getIosSplashConfig.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\ntype ExpoConfigIosSplash = NonNullable<NonNullable<ExpoConfig['ios']>['splash']>;\n\nconst defaultResizeMode = 'contain';\nconst defaultBackgroundColor = '#ffffff';\n\nexport interface IOSSplashConfig {\n image?: string | null;\n // tabletImage: string | null;\n backgroundColor: string;\n resizeMode: NonNullable<ExpoConfigIosSplash['resizeMode']>;\n tabletImage: string | null;\n // TODO: These are here just to test the functionality, the API should be more robust and account for tablet images.\n tabletBackgroundColor: string | null;\n dark?: {\n image?: string | null;\n backgroundColor?: string | null;\n tabletImage?: string | null;\n tabletBackgroundColor?: string | null;\n };\n}\n\n// TODO: Maybe use an array on splash with theme value. Then remove the array in serialization for legacy and manifest.\nexport function getIosSplashConfig(config: ExpoConfig): IOSSplashConfig | 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 iOS.\n if (config.ios?.splash) {\n const splash = config.ios?.splash;\n const image = splash.image ?? null;\n return {\n image,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n backgroundColor: splash.backgroundColor ?? defaultBackgroundColor,\n tabletImage: splash.tabletImage ?? null,\n tabletBackgroundColor: splash.tabletBackgroundColor,\n dark: {\n image: splash.dark?.image ?? null,\n backgroundColor: splash.dark?.backgroundColor,\n tabletImage: splash.dark?.tabletImage ?? null,\n tabletBackgroundColor: splash.dark?.tabletBackgroundColor,\n },\n };\n }\n\n if (config.splash) {\n const splash = config.splash;\n const image = splash.image ?? null;\n return {\n image,\n resizeMode: splash.resizeMode ?? defaultResizeMode,\n backgroundColor: splash.backgroundColor ?? defaultBackgroundColor,\n tabletImage: null,\n tabletBackgroundColor: null,\n dark: {\n image: null,\n backgroundColor: null,\n tabletImage: null,\n tabletBackgroundColor: null,\n },\n };\n }\n\n return {\n backgroundColor: '#ffffff',\n resizeMode: 'contain',\n tabletImage: null,\n tabletBackgroundColor: null,\n };\n}\n"],"mappings":";;;;;;AAIA,MAAMA,iBAAiB,GAAG,SAAS;AACnC,MAAMC,sBAAsB,GAAG,SAAS;AAkBxC;AACO,SAASC,kBAAkBA,CAACC,MAAkB,EAA0B;EAC7E;EACA;EACA,IAAIA,MAAM,CAACC,GAAG,EAAEC,MAAM,EAAE;IACtB,MAAMA,MAAM,GAAGF,MAAM,CAACC,GAAG,EAAEC,MAAM;IACjC,MAAMC,KAAK,GAAGD,MAAM,CAACC,KAAK,IAAI,IAAI;IAClC,OAAO;MACLA,KAAK;MACLC,UAAU,EAAEF,MAAM,CAACE,UAAU,IAAIP,iBAAiB;MAClDQ,eAAe,EAAEH,MAAM,CAACG,eAAe,IAAIP,sBAAsB;MACjEQ,WAAW,EAAEJ,MAAM,CAACI,WAAW,IAAI,IAAI;MACvCC,qBAAqB,EAAEL,MAAM,CAACK,qBAAqB;MACnDC,IAAI,EAAE;QACJL,KAAK,EAAED,MAAM,CAACM,IAAI,EAAEL,KAAK,IAAI,IAAI;QACjCE,eAAe,EAAEH,MAAM,CAACM,IAAI,EAAEH,eAAe;QAC7CC,WAAW,EAAEJ,MAAM,CAACM,IAAI,EAAEF,WAAW,IAAI,IAAI;QAC7CC,qBAAqB,EAAEL,MAAM,CAACM,IAAI,EAAED;MACtC;IACF,CAAC;EACH;EAEA,IAAIP,MAAM,CAACE,MAAM,EAAE;IACjB,MAAMA,MAAM,GAAGF,MAAM,CAACE,MAAM;IAC5B,MAAMC,KAAK,GAAGD,MAAM,CAACC,KAAK,IAAI,IAAI;IAClC,OAAO;MACLA,KAAK;MACLC,UAAU,EAAEF,MAAM,CAACE,UAAU,IAAIP,iBAAiB;MAClDQ,eAAe,EAAEH,MAAM,CAACG,eAAe,IAAIP,sBAAsB;MACjEQ,WAAW,EAAE,IAAI;MACjBC,qBAAqB,EAAE,IAAI;MAC3BC,IAAI,EAAE;QACJL,KAAK,EAAE,IAAI;QACXE,eAAe,EAAE,IAAI;QACrBC,WAAW,EAAE,IAAI;QACjBC,qBAAqB,EAAE;MACzB;IACF,CAAC;EACH;EAEA,OAAO;IACLF,eAAe,EAAE,SAAS;IAC1BD,UAAU,EAAE,SAAS;IACrBE,WAAW,EAAE,IAAI;IACjBC,qBAAqB,EAAE;EACzB,CAAC;AACH","ignoreList":[]}

View File

@@ -0,0 +1,4 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { SplashScreenConfig } from './getAndroidSplashConfig';
export declare const withAndroidSplashDrawables: ConfigPlugin<Pick<SplashScreenConfig, 'resizeMode'>>;
export declare function setSplashDrawableAsync({ resizeMode }: Pick<SplashScreenConfig, 'resizeMode'>, projectRoot: string): Promise<void>;

View File

@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setSplashDrawableAsync = setSplashDrawableAsync;
exports.withAndroidSplashDrawables = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
const withAndroidSplashDrawables = (config, splash) => {
return (0, _configPlugins().withDangerousMod)(config, ['android', async config => {
if (splash) {
await setSplashDrawableAsync(splash, config.modRequest.projectRoot);
}
return config;
}]);
};
exports.withAndroidSplashDrawables = withAndroidSplashDrawables;
async function setSplashDrawableAsync({
resizeMode
}, projectRoot) {
const filePath = await _configPlugins().AndroidConfig.Paths.getResourceXMLPathAsync(projectRoot, {
name: 'splashscreen',
kind: 'drawable'
});
// Nuke and rewrite the splashscreen.xml drawable
const xmlContent = {
'layer-list': {
$: {
'xmlns:android': 'http://schemas.android.com/apk/res/android'
},
item: [{
$: {
// TODO: Ensure these keys don't get out of sync
'android:drawable': '@color/splashscreen_background'
}
},
// Only include the image if resizeMode native is in-use.
resizeMode === 'native' && {
bitmap: [{
$: {
'android:gravity': 'center',
// TODO: Ensure these keys don't get out of sync
'android:src': '@drawable/splashscreen_image'
}
}]
}].filter(Boolean)
}
};
await _configPlugins().XML.writeXMLAsync({
path: filePath,
xml: xmlContent
});
}
//# sourceMappingURL=withAndroidSplashDrawables.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withAndroidSplashDrawables.js","names":["_configPlugins","data","require","withAndroidSplashDrawables","config","splash","withDangerousMod","setSplashDrawableAsync","modRequest","projectRoot","exports","resizeMode","filePath","AndroidConfig","Paths","getResourceXMLPathAsync","name","kind","xmlContent","$","item","bitmap","filter","Boolean","XML","writeXMLAsync","path","xml"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withDangerousMod, XML } from '@expo/config-plugins';\n\nimport { SplashScreenConfig } from './getAndroidSplashConfig';\n\nexport const withAndroidSplashDrawables: ConfigPlugin<Pick<SplashScreenConfig, 'resizeMode'>> = (\n config,\n splash\n) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n if (splash) {\n await setSplashDrawableAsync(splash, config.modRequest.projectRoot);\n }\n return config;\n },\n ]);\n};\n\nexport async function setSplashDrawableAsync(\n { resizeMode }: Pick<SplashScreenConfig, 'resizeMode'>,\n projectRoot: string\n) {\n const filePath = (await AndroidConfig.Paths.getResourceXMLPathAsync(projectRoot, {\n name: 'splashscreen',\n kind: 'drawable',\n }))!;\n\n // Nuke and rewrite the splashscreen.xml drawable\n const xmlContent = {\n 'layer-list': {\n $: {\n 'xmlns:android': 'http://schemas.android.com/apk/res/android',\n },\n item: [\n {\n $: {\n // TODO: Ensure these keys don't get out of sync\n 'android:drawable': '@color/splashscreen_background',\n },\n },\n // Only include the image if resizeMode native is in-use.\n resizeMode === 'native' && {\n bitmap: [\n {\n $: {\n 'android:gravity': 'center',\n // TODO: Ensure these keys don't get out of sync\n 'android:src': '@drawable/splashscreen_image',\n },\n },\n ],\n },\n ].filter(Boolean),\n },\n };\n await XML.writeXMLAsync({ path: filePath, xml: xmlContent });\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,MAAME,0BAAgF,GAAGA,CAC9FC,MAAM,EACNC,MAAM,KACH;EACH,OAAO,IAAAC,iCAAgB,EAACF,MAAM,EAAE,CAC9B,SAAS,EACT,MAAOA,MAAM,IAAK;IAChB,IAAIC,MAAM,EAAE;MACV,MAAME,sBAAsB,CAACF,MAAM,EAAED,MAAM,CAACI,UAAU,CAACC,WAAW,CAAC;IACrE;IACA,OAAOL,MAAM;EACf,CAAC,CACF,CAAC;AACJ,CAAC;AAACM,OAAA,CAAAP,0BAAA,GAAAA,0BAAA;AAEK,eAAeI,sBAAsBA,CAC1C;EAAEI;AAAmD,CAAC,EACtDF,WAAmB,EACnB;EACA,MAAMG,QAAQ,GAAI,MAAMC,8BAAa,CAACC,KAAK,CAACC,uBAAuB,CAACN,WAAW,EAAE;IAC/EO,IAAI,EAAE,cAAc;IACpBC,IAAI,EAAE;EACR,CAAC,CAAG;;EAEJ;EACA,MAAMC,UAAU,GAAG;IACjB,YAAY,EAAE;MACZC,CAAC,EAAE;QACD,eAAe,EAAE;MACnB,CAAC;MACDC,IAAI,EAAE,CACJ;QACED,CAAC,EAAE;UACD;UACA,kBAAkB,EAAE;QACtB;MACF,CAAC;MACD;MACAR,UAAU,KAAK,QAAQ,IAAI;QACzBU,MAAM,EAAE,CACN;UACEF,CAAC,EAAE;YACD,iBAAiB,EAAE,QAAQ;YAC3B;YACA,aAAa,EAAE;UACjB;QACF,CAAC;MAEL,CAAC,CACF,CAACG,MAAM,CAACC,OAAO;IAClB;EACF,CAAC;EACD,MAAMC,oBAAG,CAACC,aAAa,CAAC;IAAEC,IAAI,EAAEd,QAAQ;IAAEe,GAAG,EAAET;EAAW,CAAC,CAAC;AAC9D","ignoreList":[]}

View File

@@ -0,0 +1,13 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
import { SplashScreenConfig } from './getAndroidSplashConfig';
export declare const withAndroidSplashImages: ConfigPlugin;
/**
* Deletes all previous splash_screen_images and copies new one to desired drawable directory.
* If path isn't provided then no new image is placed in drawable directories.
* @see https://developer.android.com/training/multiscreen/screendensities
*
* @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.
*/
export declare function setSplashImageDrawablesAsync(config: Pick<ExpoConfig, 'android' | 'splash'>, projectRoot: string): Promise<void>;
export declare function setSplashImageDrawablesForThemeAsync(config: SplashScreenConfig | null, theme: 'dark' | 'light', projectRoot: string): Promise<void>;

View File

@@ -0,0 +1,181 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setSplashImageDrawablesAsync = setSplashImageDrawablesAsync;
exports.setSplashImageDrawablesForThemeAsync = setSplashImageDrawablesForThemeAsync;
exports.withAndroidSplashImages = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _imageUtils() {
const data = require("@expo/image-utils");
_imageUtils = function () {
return data;
};
return data;
}
function _fsExtra() {
const data = _interopRequireDefault(require("fs-extra"));
_fsExtra = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _getAndroidSplashConfig() {
const data = require("./getAndroidSplashConfig");
_getAndroidSplashConfig = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const IMAGE_CACHE_NAME = 'splash-android';
const SPLASH_SCREEN_FILENAME = 'splashscreen_image.png';
const DRAWABLES_CONFIGS = {
default: {
modes: {
light: {
path: `./res/drawable/${SPLASH_SCREEN_FILENAME}`
},
dark: {
path: `./res/drawable-night/${SPLASH_SCREEN_FILENAME}`
}
},
dimensionsMultiplier: 1
},
mdpi: {
modes: {
light: {
path: `./res/drawable-mdpi/${SPLASH_SCREEN_FILENAME}`
},
dark: {
path: `./res/drawable-night-mdpi/${SPLASH_SCREEN_FILENAME}`
}
},
dimensionsMultiplier: 1
},
hdpi: {
modes: {
light: {
path: `./res/drawable-hdpi/${SPLASH_SCREEN_FILENAME}`
},
dark: {
path: `./res/drawable-night-hdpi/${SPLASH_SCREEN_FILENAME}`
}
},
dimensionsMultiplier: 1.5
},
xhdpi: {
modes: {
light: {
path: `./res/drawable-xhdpi/${SPLASH_SCREEN_FILENAME}`
},
dark: {
path: `./res/drawable-night-xhdpi/${SPLASH_SCREEN_FILENAME}`
}
},
dimensionsMultiplier: 2
},
xxhdpi: {
modes: {
light: {
path: `./res/drawable-xxhdpi/${SPLASH_SCREEN_FILENAME}`
},
dark: {
path: `./res/drawable-night-xxhdpi/${SPLASH_SCREEN_FILENAME}`
}
},
dimensionsMultiplier: 3
},
xxxhdpi: {
modes: {
light: {
path: `./res/drawable-xxxhdpi/${SPLASH_SCREEN_FILENAME}`
},
dark: {
path: `./res/drawable-night-xxxhdpi/${SPLASH_SCREEN_FILENAME}`
}
},
dimensionsMultiplier: 4
}
};
const withAndroidSplashImages = config => {
return (0, _configPlugins().withDangerousMod)(config, ['android', async config => {
await setSplashImageDrawablesAsync(config, config.modRequest.projectRoot);
return config;
}]);
};
/**
* Deletes all previous splash_screen_images and copies new one to desired drawable directory.
* If path isn't provided then no new image is placed in drawable directories.
* @see https://developer.android.com/training/multiscreen/screendensities
*
* @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.
*/
exports.withAndroidSplashImages = withAndroidSplashImages;
async function setSplashImageDrawablesAsync(config, projectRoot) {
await clearAllExistingSplashImagesAsync(projectRoot);
const splash = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
const darkSplash = (0, _getAndroidSplashConfig().getAndroidDarkSplashConfig)(config);
await Promise.all([setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot), setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot)]);
}
async function clearAllExistingSplashImagesAsync(projectRoot) {
const androidMainPath = _path().default.join(projectRoot, 'android/app/src/main');
await Promise.all(Object.values(DRAWABLES_CONFIGS).map(async ({
modes
}) => {
await Promise.all(Object.values(modes).map(async ({
path: filePath
}) => {
if (await _fsExtra().default.pathExists(_path().default.resolve(androidMainPath, filePath))) {
await _fsExtra().default.remove(_path().default.resolve(androidMainPath, filePath));
}
}));
}));
}
async function setSplashImageDrawablesForThemeAsync(config, theme, projectRoot) {
if (!config) return;
const androidMainPath = _path().default.join(projectRoot, 'android/app/src/main');
await Promise.all(['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'].map(async imageKey => {
// @ts-ignore
const image = config[imageKey];
if (image) {
// Using this method will cache the images in `.expo` based on the properties used to generate them.
// this method also supports remote URLs and using the global sharp instance.
const {
source
} = await (0, _imageUtils().generateImageAsync)({
projectRoot,
cacheType: IMAGE_CACHE_NAME
}, {
src: image
});
// Get output path for drawable.
const outputPath = _path().default.join(androidMainPath,
// @ts-ignore
DRAWABLES_CONFIGS[imageKey].modes[theme].path);
// Ensure directory exists.
const folder = _path().default.dirname(outputPath);
await _fsExtra().default.ensureDir(folder);
// Write image buffer to the file system.
await _fsExtra().default.writeFile(outputPath, source);
}
return null;
}));
}
//# sourceMappingURL=withAndroidSplashImages.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
export declare const withAndroidSplashLegacyMainActivity: ConfigPlugin;
export declare function setSplashScreenLegacyMainActivity(config: Pick<ExpoConfig, 'android' | 'androidStatusBar' | 'userInterfaceStyle'>, mainActivity: string, language: 'java' | 'kt'): string;

View File

@@ -0,0 +1,117 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setSplashScreenLegacyMainActivity = setSplashScreenLegacyMainActivity;
exports.withAndroidSplashLegacyMainActivity = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _codeMod() {
const data = require("@expo/config-plugins/build/android/codeMod");
_codeMod = function () {
return data;
};
return data;
}
function _generateCode() {
const data = require("@expo/config-plugins/build/utils/generateCode");
_generateCode = function () {
return data;
};
return data;
}
function _debug() {
const data = _interopRequireDefault(require("debug"));
_debug = function () {
return data;
};
return data;
}
function _getAndroidSplashConfig() {
const data = require("./getAndroidSplashConfig");
_getAndroidSplashConfig = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:android:mainActivity');
// DO NOT CHANGE
const SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';
const withAndroidSplashLegacyMainActivity = config => {
return (0, _configPlugins().withMainActivity)(config, config => {
config.modResults.contents = setSplashScreenLegacyMainActivity(config, config.modResults.contents, config.modResults.language);
return config;
});
};
exports.withAndroidSplashLegacyMainActivity = withAndroidSplashLegacyMainActivity;
function setSplashScreenLegacyMainActivity(config, mainActivity, language) {
debug(`Modify with language: "${language}"`);
const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
if (!splashConfig) {
// Remove our generated code safely...
const mod = (0, _generateCode().removeContents)({
src: mainActivity,
tag: SHOW_SPLASH_ID
});
mainActivity = mod.contents;
if (mod.didClear) {
debug('Removed SplashScreen.show()');
}
return mainActivity;
}
// TODO: Translucent is weird
const statusBarTranslucent = !!config.androidStatusBar?.translucent;
const {
resizeMode
} = splashConfig;
const isJava = language === 'java';
const LE = isJava ? ';' : '';
mainActivity = (0, _codeMod().addImports)(mainActivity, ['expo.modules.splashscreen.singletons.SplashScreen', 'expo.modules.splashscreen.SplashScreenImageResizeMode', 'com.facebook.react.ReactRootView', 'android.os.Bundle'], isJava);
if (!mainActivity.match(/(?<=^.*super\.onCreate.*$)/m)) {
const onCreateBlock = isJava ? [' @Override', ' protected void onCreate(Bundle savedInstanceState) {', ' super.onCreate(savedInstanceState);', ' }'] : [' override fun onCreate(savedInstanceState: Bundle?) {', ' super.onCreate(savedInstanceState)', ' }'];
mainActivity = (0, _generateCode().mergeContents)({
src: mainActivity,
// insert just below super.onCreate
anchor: isJava ? /(?<=public\s+class\s+.*\s+extends\s+.*\s+{.*$)/m : /(?<=class\s+.*\s+:\s+.*\s+{.*$)/m,
offset: 1,
comment: '//',
tag: 'expo-splash-screen-mainActivity-onCreate',
newSrc: onCreateBlock.join('\n')
}).contents;
}
// Remove our generated code safely...
mainActivity = (0, _generateCode().removeContents)({
src: mainActivity,
tag: SHOW_SPLASH_ID
}).contents;
// Remove code from `@expo/configure-splash-screen`
mainActivity = mainActivity.split('\n').filter(line => {
return !/SplashScreen\.show\(this,\s?SplashScreenImageResizeMode\./.test(line);
}).join('\n');
// Reapply generated code.
mainActivity = (0, _generateCode().mergeContents)({
src: mainActivity,
// insert just below super.onCreate
anchor: /(?<=^.*super\.onCreate.*$)/m,
offset: 1,
comment: '//',
tag: SHOW_SPLASH_ID,
newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${isJava ? '.class' : '::class.java'}, ${statusBarTranslucent})${LE}`
}).contents;
// TODO: Remove old `SplashScreen.show`
return mainActivity;
}
//# sourceMappingURL=withAndroidSplashLegacyMainActivity.js.map

View File

@@ -0,0 +1,2 @@
import { ConfigPlugin } from '@expo/config-plugins';
export declare const withAndroidSplashScreen: ConfigPlugin;

View File

@@ -0,0 +1,108 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.withAndroidSplashScreen = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _jsonFile() {
const data = _interopRequireDefault(require("@expo/json-file"));
_jsonFile = function () {
return data;
};
return data;
}
function _resolveFrom() {
const data = _interopRequireDefault(require("resolve-from"));
_resolveFrom = function () {
return data;
};
return data;
}
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
function _getAndroidSplashConfig() {
const data = require("./getAndroidSplashConfig");
_getAndroidSplashConfig = function () {
return data;
};
return data;
}
function _withAndroidSplashDrawables() {
const data = require("./withAndroidSplashDrawables");
_withAndroidSplashDrawables = function () {
return data;
};
return data;
}
function _withAndroidSplashImages() {
const data = require("./withAndroidSplashImages");
_withAndroidSplashImages = function () {
return data;
};
return data;
}
function _withAndroidSplashLegacyMainActivity() {
const data = require("./withAndroidSplashLegacyMainActivity");
_withAndroidSplashLegacyMainActivity = function () {
return data;
};
return data;
}
function _withAndroidSplashStrings() {
const data = require("./withAndroidSplashStrings");
_withAndroidSplashStrings = function () {
return data;
};
return data;
}
function _withAndroidSplashStyles() {
const data = require("./withAndroidSplashStyles");
_withAndroidSplashStyles = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const withAndroidSplashScreen = config => {
const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
// Update the android status bar to match the splash screen
// androidStatusBar applies info to the app activity style.
const backgroundColor = splashConfig?.backgroundColor || '#ffffff';
if (config.androidStatusBar?.backgroundColor) {
if (backgroundColor.toLowerCase() !== config.androidStatusBar?.backgroundColor?.toLowerCase?.()) {
_configPlugins().WarningAggregator.addWarningAndroid('androidStatusBar.backgroundColor', 'Color conflicts with the splash.backgroundColor');
}
} else {
if (!config.androidStatusBar) config.androidStatusBar = {};
config.androidStatusBar.backgroundColor = backgroundColor;
}
return (0, _configPlugins().withPlugins)(config, [_withAndroidSplashImages().withAndroidSplashImages, [_withAndroidSplashDrawables().withAndroidSplashDrawables, splashConfig], ...(shouldUpdateLegacyMainActivity(config) ? [_withAndroidSplashLegacyMainActivity().withAndroidSplashLegacyMainActivity] : []), _withAndroidSplashStyles().withAndroidSplashStyles, _withAndroidSplashStrings().withAndroidSplashStrings]);
};
exports.withAndroidSplashScreen = withAndroidSplashScreen;
function shouldUpdateLegacyMainActivity(config) {
try {
const projectRoot = config._internal?.projectRoot;
const packagePath = (0, _resolveFrom().default)(projectRoot, 'expo-splash-screen/package.json');
if (packagePath) {
const version = _jsonFile().default.read(packagePath).version?.toString() ?? '';
return _semver().default.lt(version, '0.12.0');
}
// If expo-splash-screen didn't be installed or included in template, we check the sdkVersion instead.
return !!(config.sdkVersion && _semver().default.lt(config.sdkVersion, '43.0.0'));
} catch {}
return false;
}
//# sourceMappingURL=withAndroidSplashScreen.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
export declare const withAndroidSplashStrings: ConfigPlugin;
export declare function setSplashStrings(strings: AndroidConfig.Resources.ResourceXML, resizeMode: string, statusBarTranslucent: boolean): AndroidConfig.Resources.ResourceXML;

View File

@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setSplashStrings = setSplashStrings;
exports.withAndroidSplashStrings = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _getAndroidSplashConfig() {
const data = require("./getAndroidSplashConfig");
_getAndroidSplashConfig = function () {
return data;
};
return data;
}
const RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';
const STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';
const withAndroidSplashStrings = config => {
return (0, _configPlugins().withStringsXml)(config, config => {
const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
if (splashConfig) {
const {
resizeMode
} = splashConfig;
const statusBarTranslucent = !!config.androidStatusBar?.translucent;
config.modResults = setSplashStrings(config.modResults, resizeMode, statusBarTranslucent);
}
return config;
});
};
exports.withAndroidSplashStrings = withAndroidSplashStrings;
function setSplashStrings(strings, resizeMode, statusBarTranslucent) {
return _configPlugins().AndroidConfig.Strings.setStringItem([_configPlugins().AndroidConfig.Resources.buildResourceItem({
name: RESIZE_MODE_KEY,
value: resizeMode,
translatable: false
}), _configPlugins().AndroidConfig.Resources.buildResourceItem({
name: STATUS_BAR_TRANSLUCENT_KEY,
value: String(statusBarTranslucent),
translatable: false
})], strings);
}
//# sourceMappingURL=withAndroidSplashStrings.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withAndroidSplashStrings.js","names":["_configPlugins","data","require","_getAndroidSplashConfig","RESIZE_MODE_KEY","STATUS_BAR_TRANSLUCENT_KEY","withAndroidSplashStrings","config","withStringsXml","splashConfig","getAndroidSplashConfig","resizeMode","statusBarTranslucent","androidStatusBar","translucent","modResults","setSplashStrings","exports","strings","AndroidConfig","Strings","setStringItem","Resources","buildResourceItem","name","value","translatable","String"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withStringsXml } from '@expo/config-plugins';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';\nconst STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';\n\nexport const withAndroidSplashStrings: ConfigPlugin = (config) => {\n return withStringsXml(config, (config) => {\n const splashConfig = getAndroidSplashConfig(config);\n if (splashConfig) {\n const { resizeMode } = splashConfig;\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n config.modResults = setSplashStrings(config.modResults, resizeMode, statusBarTranslucent);\n }\n return config;\n });\n};\n\nexport function setSplashStrings(\n strings: AndroidConfig.Resources.ResourceXML,\n resizeMode: string,\n statusBarTranslucent: boolean\n): AndroidConfig.Resources.ResourceXML {\n return AndroidConfig.Strings.setStringItem(\n [\n AndroidConfig.Resources.buildResourceItem({\n name: RESIZE_MODE_KEY,\n value: resizeMode,\n translatable: false,\n }),\n AndroidConfig.Resources.buildResourceItem({\n name: STATUS_BAR_TRANSLUCENT_KEY,\n value: String(statusBarTranslucent),\n translatable: false,\n }),\n ],\n strings\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,wBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,uBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,eAAe,GAAG,gCAAgC;AACxD,MAAMC,0BAA0B,GAAG,2CAA2C;AAEvE,MAAMC,wBAAsC,GAAIC,MAAM,IAAK;EAChE,OAAO,IAAAC,+BAAc,EAACD,MAAM,EAAGA,MAAM,IAAK;IACxC,MAAME,YAAY,GAAG,IAAAC,gDAAsB,EAACH,MAAM,CAAC;IACnD,IAAIE,YAAY,EAAE;MAChB,MAAM;QAAEE;MAAW,CAAC,GAAGF,YAAY;MACnC,MAAMG,oBAAoB,GAAG,CAAC,CAACL,MAAM,CAACM,gBAAgB,EAAEC,WAAW;MACnEP,MAAM,CAACQ,UAAU,GAAGC,gBAAgB,CAACT,MAAM,CAACQ,UAAU,EAAEJ,UAAU,EAAEC,oBAAoB,CAAC;IAC3F;IACA,OAAOL,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACU,OAAA,CAAAX,wBAAA,GAAAA,wBAAA;AAEK,SAASU,gBAAgBA,CAC9BE,OAA4C,EAC5CP,UAAkB,EAClBC,oBAA6B,EACQ;EACrC,OAAOO,8BAAa,CAACC,OAAO,CAACC,aAAa,CACxC,CACEF,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAEpB,eAAe;IACrBqB,KAAK,EAAEd,UAAU;IACjBe,YAAY,EAAE;EAChB,CAAC,CAAC,EACFP,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAEnB,0BAA0B;IAChCoB,KAAK,EAAEE,MAAM,CAACf,oBAAoB,CAAC;IACnCc,YAAY,EAAE;EAChB,CAAC,CAAC,CACH,EACDR,OACF,CAAC;AACH","ignoreList":[]}

View File

@@ -0,0 +1,8 @@
import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
export declare const withAndroidSplashStyles: ConfigPlugin;
export declare function removeOldSplashStyleGroup(styles: AndroidConfig.Resources.ResourceXML): AndroidConfig.Resources.ResourceXML;
export declare function getSplashBackgroundColor(config: ExpoConfig): string | null;
export declare function getSplashDarkBackgroundColor(config: ExpoConfig): string | null;
export declare function setSplashStylesForTheme(styles: AndroidConfig.Resources.ResourceXML): AndroidConfig.Resources.ResourceXML;
export declare function setSplashColorsForTheme(colors: AndroidConfig.Resources.ResourceXML, backgroundColor: string | null): AndroidConfig.Resources.ResourceXML;

View File

@@ -0,0 +1,96 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getSplashBackgroundColor = getSplashBackgroundColor;
exports.getSplashDarkBackgroundColor = getSplashDarkBackgroundColor;
exports.removeOldSplashStyleGroup = removeOldSplashStyleGroup;
exports.setSplashColorsForTheme = setSplashColorsForTheme;
exports.setSplashStylesForTheme = setSplashStylesForTheme;
exports.withAndroidSplashStyles = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _android() {
const data = require("@expo/config-plugins/build/android");
_android = function () {
return data;
};
return data;
}
function _getAndroidSplashConfig() {
const data = require("./getAndroidSplashConfig");
_getAndroidSplashConfig = function () {
return data;
};
return data;
}
const styleResourceGroup = {
name: 'Theme.App.SplashScreen',
parent: 'AppTheme'
};
const SPLASH_COLOR_NAME = 'splashscreen_background';
const withAndroidSplashStyles = config => {
config = (0, _configPlugins().withAndroidColors)(config, config => {
const backgroundColor = getSplashBackgroundColor(config);
config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);
return config;
});
config = (0, _configPlugins().withAndroidColorsNight)(config, config => {
const backgroundColor = getSplashDarkBackgroundColor(config);
config.modResults = setSplashColorsForTheme(config.modResults, backgroundColor);
return config;
});
config = (0, _configPlugins().withAndroidStyles)(config, config => {
config.modResults = removeOldSplashStyleGroup(config.modResults);
config.modResults = setSplashStylesForTheme(config.modResults);
return config;
});
return config;
};
// Remove the old style group which didn't extend the base theme properly.
exports.withAndroidSplashStyles = withAndroidSplashStyles;
function removeOldSplashStyleGroup(styles) {
const group = {
name: 'Theme.App.SplashScreen',
parent: 'Theme.AppCompat.Light.NoActionBar'
};
styles.resources.style = styles.resources.style?.filter?.(({
$: head
}) => {
let matches = head.name === group.name;
if (group.parent != null && matches) {
matches = head.parent === group.parent;
}
return !matches;
});
return styles;
}
function getSplashBackgroundColor(config) {
return (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config)?.backgroundColor ?? null;
}
function getSplashDarkBackgroundColor(config) {
return (0, _getAndroidSplashConfig().getAndroidDarkSplashConfig)(config)?.backgroundColor ?? null;
}
function setSplashStylesForTheme(styles) {
// Add splash screen image
return _configPlugins().AndroidConfig.Styles.assignStylesValue(styles, {
add: true,
value: '@drawable/splashscreen',
name: 'android:windowBackground',
parent: styleResourceGroup
});
}
function setSplashColorsForTheme(colors, backgroundColor) {
return _android().Colors.assignColorValue(colors, {
value: backgroundColor,
name: SPLASH_COLOR_NAME
});
}
//# sourceMappingURL=withAndroidSplashStyles.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { IOSSplashConfig } from './getIosSplashConfig';
import { ContentsJsonImage } from '../../icons/AssetContents';
export declare const withIosSplashAssets: ConfigPlugin<IOSSplashConfig>;
export declare function buildContentsJsonImages({ image, darkImage, tabletImage, darkTabletImage, }: {
image: string;
tabletImage: string | null;
darkImage: string | null;
darkTabletImage: string | null;
}): ContentsJsonImage[];

View File

@@ -0,0 +1,293 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildContentsJsonImages = buildContentsJsonImages;
exports.withIosSplashAssets = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _imageUtils() {
const data = require("@expo/image-utils");
_imageUtils = function () {
return data;
};
return data;
}
function _debug() {
const data = _interopRequireDefault(require("debug"));
_debug = function () {
return data;
};
return data;
}
function _fsExtra() {
const data = _interopRequireDefault(require("fs-extra"));
_fsExtra = function () {
return data;
};
return data;
}
function _jimpCompact() {
const data = _interopRequireDefault(require("jimp-compact"));
_jimpCompact = function () {
return data;
};
return data;
}
function path() {
const data = _interopRequireWildcard(require("path"));
path = function () {
return data;
};
return data;
}
function _AssetContents() {
const data = require("../../icons/AssetContents");
_AssetContents = function () {
return data;
};
return data;
}
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// @ts-ignore
const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:ios:assets');
const IMAGE_CACHE_NAME = 'splash-ios';
const IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';
const BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';
const PNG_FILENAME = 'image.png';
const DARK_PNG_FILENAME = 'dark_image.png';
const TABLET_PNG_FILENAME = 'tablet_image.png';
const DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';
const withIosSplashAssets = (config, splash) => {
if (!splash) {
return config;
}
return (0, _configPlugins().withDangerousMod)(config, ['ios', async config => {
const iosNamedProjectRoot = _configPlugins().IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);
await createSplashScreenBackgroundImageAsync({
iosNamedProjectRoot,
splash
});
await configureImageAssets({
projectRoot: config.modRequest.projectRoot,
iosNamedProjectRoot,
image: splash.image,
darkImage: splash.dark?.image,
tabletImage: splash.tabletImage,
darkTabletImage: splash.dark?.tabletImage
});
return config;
}]);
};
/**
* Creates imageset containing image for Splash/Launch Screen.
*/
exports.withIosSplashAssets = withIosSplashAssets;
async function configureImageAssets({
projectRoot,
iosNamedProjectRoot,
image,
darkImage,
tabletImage,
darkTabletImage
}) {
const imageSetPath = path().resolve(iosNamedProjectRoot, IMAGESET_PATH);
// ensure old SplashScreen imageSet is removed
await _fsExtra().default.remove(imageSetPath);
if (!image) {
return;
}
await writeContentsJsonFileAsync({
assetPath: imageSetPath,
image: PNG_FILENAME,
darkImage: darkImage ? DARK_PNG_FILENAME : null,
tabletImage: tabletImage ? TABLET_PNG_FILENAME : null,
darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null
});
await copyImageFiles({
projectRoot,
iosNamedProjectRoot,
image,
darkImage,
tabletImage,
darkTabletImage
});
}
async function createPngFileAsync(color, filePath) {
const png = new (_jimpCompact().default)(1, 1, color);
return png.writeAsync(filePath);
}
async function createBackgroundImagesAsync({
iosNamedProjectRoot,
color,
darkColor,
tabletColor,
darkTabletColor
}) {
await generateImagesAssetsAsync({
async generateImageAsset(item, fileName) {
await createPngFileAsync(item, path().resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName));
},
anyItem: color,
darkItem: darkColor,
tabletItem: tabletColor,
darkTabletItem: darkTabletColor
});
}
async function copyImageFiles({
projectRoot,
iosNamedProjectRoot,
image,
darkImage,
tabletImage,
darkTabletImage
}) {
await generateImagesAssetsAsync({
async generateImageAsset(item, fileName) {
// Using this method will cache the images in `.expo` based on the properties used to generate them.
// this method also supports remote URLs and using the global sharp instance.
const {
source
} = await (0, _imageUtils().generateImageAsync)({
projectRoot,
cacheType: IMAGE_CACHE_NAME
}, {
src: item
});
// Write image buffer to the file system.
// const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);
await _fsExtra().default.writeFile(path().resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);
},
anyItem: image,
darkItem: darkImage,
tabletItem: tabletImage,
darkTabletItem: darkTabletImage
});
}
async function generateImagesAssetsAsync({
generateImageAsset,
anyItem,
darkItem,
tabletItem,
darkTabletItem
}) {
const items = [[anyItem, PNG_FILENAME], [darkItem, DARK_PNG_FILENAME], [tabletItem, TABLET_PNG_FILENAME], [darkTabletItem, DARK_TABLET_PNG_FILENAME]].filter(([item]) => !!item);
await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));
}
async function createSplashScreenBackgroundImageAsync({
iosNamedProjectRoot,
splash
}) {
const color = splash.backgroundColor;
const darkColor = splash.dark?.backgroundColor;
const tabletColor = splash.tabletBackgroundColor;
const darkTabletColor = splash.dark?.tabletBackgroundColor;
const imagesetPath = path().join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);
// Ensure the Images.xcassets/... path exists
await _fsExtra().default.remove(imagesetPath);
await _fsExtra().default.ensureDir(imagesetPath);
await createBackgroundImagesAsync({
iosNamedProjectRoot,
color,
darkColor: darkColor ? darkColor : null,
tabletColor: tabletColor ? tabletColor : null,
darkTabletColor: darkTabletColor ? darkTabletColor : null
});
await writeContentsJsonFileAsync({
assetPath: path().resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH),
image: PNG_FILENAME,
darkImage: darkColor ? DARK_PNG_FILENAME : null,
tabletImage: tabletColor ? TABLET_PNG_FILENAME : null,
darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null
});
}
const darkAppearances = [{
appearance: 'luminosity',
value: 'dark'
}];
function buildContentsJsonImages({
image,
darkImage,
tabletImage,
darkTabletImage
}) {
return [
// Phone light
(0, _AssetContents().createContentsJsonItem)({
idiom: 'universal',
filename: image,
scale: '1x'
}), (0, _AssetContents().createContentsJsonItem)({
idiom: 'universal',
scale: '2x'
}), (0, _AssetContents().createContentsJsonItem)({
idiom: 'universal',
scale: '3x'
}),
// Phone dark
darkImage && (0, _AssetContents().createContentsJsonItem)({
idiom: 'universal',
appearances: darkAppearances,
filename: darkImage,
scale: '1x'
}), darkImage && (0, _AssetContents().createContentsJsonItem)({
idiom: 'universal',
appearances: darkAppearances,
scale: '2x'
}), darkImage && (0, _AssetContents().createContentsJsonItem)({
idiom: 'universal',
appearances: darkAppearances,
scale: '3x'
}),
// Tablet light
tabletImage && (0, _AssetContents().createContentsJsonItem)({
idiom: 'ipad',
filename: tabletImage,
scale: '1x'
}), tabletImage && (0, _AssetContents().createContentsJsonItem)({
idiom: 'ipad',
scale: '2x'
}),
// Phone dark
darkTabletImage && (0, _AssetContents().createContentsJsonItem)({
idiom: 'ipad',
appearances: darkAppearances,
filename: darkTabletImage ?? undefined,
scale: '1x'
}), darkTabletImage && (0, _AssetContents().createContentsJsonItem)({
idiom: 'ipad',
appearances: darkAppearances,
scale: '2x'
})].filter(Boolean);
}
async function writeContentsJsonFileAsync({
assetPath,
image,
darkImage,
tabletImage,
darkTabletImage
}) {
const images = buildContentsJsonImages({
image,
darkImage,
tabletImage,
darkTabletImage
});
debug(`create contents.json:`, assetPath);
debug(`use images:`, images);
await (0, _AssetContents().writeContentsJsonAsync)(assetPath, {
images
});
}
//# sourceMappingURL=withIosSplashAssets.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
import { ConfigPlugin, InfoPlist } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
import { IOSSplashConfig } from './getIosSplashConfig';
export declare const withIosSplashInfoPlist: ConfigPlugin<IOSSplashConfig>;
export declare function setSplashInfoPlist(config: ExpoConfig, infoPlist: InfoPlist, splash: IOSSplashConfig): InfoPlist;

View File

@@ -0,0 +1,58 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setSplashInfoPlist = setSplashInfoPlist;
exports.withIosSplashInfoPlist = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _debug() {
const data = _interopRequireDefault(require("debug"));
_debug = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:ios:infoPlist');
const withIosSplashInfoPlist = (config, splash) => {
return (0, _configPlugins().withInfoPlist)(config, config => {
config.modResults = setSplashInfoPlist(config, config.modResults, splash);
return config;
});
};
exports.withIosSplashInfoPlist = withIosSplashInfoPlist;
function setSplashInfoPlist(config, infoPlist, splash) {
const isDarkModeEnabled = !!(splash?.dark?.image || splash?.dark?.tabletImage || splash?.dark?.backgroundColor || splash?.dark?.tabletBackgroundColor);
debug(`isDarkModeEnabled: `, isDarkModeEnabled);
if (isDarkModeEnabled) {
// IOSConfig.UserInterfaceStyle.getUserInterfaceStyle(config);
// Determine if the user manually defined the userInterfaceStyle incorrectly
const existing = config.ios?.userInterfaceStyle ?? config.userInterfaceStyle;
// Add a warning to prevent the dark mode splash screen from not being shown -- this was learned the hard way.
if (existing && existing !== 'automatic') {
_configPlugins().WarningAggregator.addWarningIOS('userInterfaceStyle', 'The existing `userInterfaceStyle` property is preventing splash screen from working properly. Please remove it or disable dark mode splash screens.');
}
// assigning it to auto anyways, but this is fragile because the order of operations matter now
infoPlist.UIUserInterfaceStyle = 'Automatic';
} else {
// NOTE(brentvatne): Commented out this line because it causes https://github.com/expo/expo-cli/issues/3935
// We should revisit this approach.
// delete infoPlist.UIUserInterfaceStyle;
}
if (splash) {
// TODO: What to do here ??
infoPlist.UILaunchStoryboardName = 'SplashScreen';
} else {
debug(`Disabling UILaunchStoryboardName`);
delete infoPlist.UILaunchStoryboardName;
}
return infoPlist;
}
//# sourceMappingURL=withIosSplashInfoPlist.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withIosSplashInfoPlist.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","obj","__esModule","default","debug","Debug","withIosSplashInfoPlist","config","splash","withInfoPlist","modResults","setSplashInfoPlist","exports","infoPlist","isDarkModeEnabled","dark","image","tabletImage","backgroundColor","tabletBackgroundColor","existing","ios","userInterfaceStyle","WarningAggregator","addWarningIOS","UIUserInterfaceStyle","UILaunchStoryboardName"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, WarningAggregator, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { IOSSplashConfig } from './getIosSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:infoPlist');\n\nexport const withIosSplashInfoPlist: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setSplashInfoPlist(config, config.modResults, splash);\n return config;\n });\n};\n\nexport function setSplashInfoPlist(\n config: ExpoConfig,\n infoPlist: InfoPlist,\n splash: IOSSplashConfig\n): InfoPlist {\n const isDarkModeEnabled = !!(\n splash?.dark?.image ||\n splash?.dark?.tabletImage ||\n splash?.dark?.backgroundColor ||\n splash?.dark?.tabletBackgroundColor\n );\n debug(`isDarkModeEnabled: `, isDarkModeEnabled);\n\n if (isDarkModeEnabled) {\n // IOSConfig.UserInterfaceStyle.getUserInterfaceStyle(config);\n // Determine if the user manually defined the userInterfaceStyle incorrectly\n const existing = config.ios?.userInterfaceStyle ?? config.userInterfaceStyle;\n // Add a warning to prevent the dark mode splash screen from not being shown -- this was learned the hard way.\n if (existing && existing !== 'automatic') {\n WarningAggregator.addWarningIOS(\n 'userInterfaceStyle',\n 'The existing `userInterfaceStyle` property is preventing splash screen from working properly. Please remove it or disable dark mode splash screens.'\n );\n }\n // assigning it to auto anyways, but this is fragile because the order of operations matter now\n infoPlist.UIUserInterfaceStyle = 'Automatic';\n } else {\n // NOTE(brentvatne): Commented out this line because it causes https://github.com/expo/expo-cli/issues/3935\n // We should revisit this approach.\n // delete infoPlist.UIUserInterfaceStyle;\n }\n\n if (splash) {\n // TODO: What to do here ??\n infoPlist.UILaunchStoryboardName = 'SplashScreen';\n } else {\n debug(`Disabling UILaunchStoryboardName`);\n delete infoPlist.UILaunchStoryboardName;\n }\n\n return infoPlist;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAI1B,MAAMG,KAAK,GAAG,IAAAC,gBAAK,EAAC,uDAAuD,CAAC;AAErE,MAAMC,sBAAqD,GAAGA,CAACC,MAAM,EAAEC,MAAM,KAAK;EACvF,OAAO,IAAAC,8BAAa,EAACF,MAAM,EAAGA,MAAM,IAAK;IACvCA,MAAM,CAACG,UAAU,GAAGC,kBAAkB,CAACJ,MAAM,EAAEA,MAAM,CAACG,UAAU,EAAEF,MAAM,CAAC;IACzE,OAAOD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACK,OAAA,CAAAN,sBAAA,GAAAA,sBAAA;AAEK,SAASK,kBAAkBA,CAChCJ,MAAkB,EAClBM,SAAoB,EACpBL,MAAuB,EACZ;EACX,MAAMM,iBAAiB,GAAG,CAAC,EACzBN,MAAM,EAAEO,IAAI,EAAEC,KAAK,IACnBR,MAAM,EAAEO,IAAI,EAAEE,WAAW,IACzBT,MAAM,EAAEO,IAAI,EAAEG,eAAe,IAC7BV,MAAM,EAAEO,IAAI,EAAEI,qBAAqB,CACpC;EACDf,KAAK,CAAC,qBAAqB,EAAEU,iBAAiB,CAAC;EAE/C,IAAIA,iBAAiB,EAAE;IACrB;IACA;IACA,MAAMM,QAAQ,GAAGb,MAAM,CAACc,GAAG,EAAEC,kBAAkB,IAAIf,MAAM,CAACe,kBAAkB;IAC5E;IACA,IAAIF,QAAQ,IAAIA,QAAQ,KAAK,WAAW,EAAE;MACxCG,kCAAiB,CAACC,aAAa,CAC7B,oBAAoB,EACpB,qJACF,CAAC;IACH;IACA;IACAX,SAAS,CAACY,oBAAoB,GAAG,WAAW;EAC9C,CAAC,MAAM;IACL;IACA;IACA;EAAA;EAGF,IAAIjB,MAAM,EAAE;IACV;IACAK,SAAS,CAACa,sBAAsB,GAAG,cAAc;EACnD,CAAC,MAAM;IACLtB,KAAK,CAAC,kCAAkC,CAAC;IACzC,OAAOS,SAAS,CAACa,sBAAsB;EACzC;EAEA,OAAOb,SAAS;AAClB","ignoreList":[]}

View File

@@ -0,0 +1,3 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { IOSSplashConfig } from './getIosSplashConfig';
export declare const withIosSplashScreen: ConfigPlugin<IOSSplashConfig | undefined | null | void>;

View File

@@ -0,0 +1,83 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.withIosSplashScreen = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _debug() {
const data = _interopRequireDefault(require("debug"));
_debug = function () {
return data;
};
return data;
}
function _getIosSplashConfig() {
const data = require("./getIosSplashConfig");
_getIosSplashConfig = function () {
return data;
};
return data;
}
function _withIosSplashAssets() {
const data = require("./withIosSplashAssets");
_withIosSplashAssets = function () {
return data;
};
return data;
}
function _withIosSplashInfoPlist() {
const data = require("./withIosSplashInfoPlist");
_withIosSplashInfoPlist = function () {
return data;
};
return data;
}
function _withIosSplashScreenStoryboard() {
const data = require("./withIosSplashScreenStoryboard");
_withIosSplashScreenStoryboard = function () {
return data;
};
return data;
}
function _withIosSplashXcodeProject() {
const data = require("./withIosSplashXcodeProject");
_withIosSplashXcodeProject = function () {
return data;
};
return data;
}
function _wtihIosSplashScreenStoryboardImage() {
const data = require("./wtihIosSplashScreenStoryboardImage");
_wtihIosSplashScreenStoryboardImage = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:ios');
const withIosSplashScreen = (config, splash) => {
// If the user didn't specify a splash object, infer the splash object from the Expo config.
if (!splash) {
splash = (0, _getIosSplashConfig().getIosSplashConfig)(config);
} else {
debug(`custom splash config provided`);
}
debug(`config:`, splash);
return (0, _configPlugins().withPlugins)(config, [[_withIosSplashInfoPlist().withIosSplashInfoPlist, splash], [_withIosSplashAssets().withIosSplashAssets, splash],
// Add the image settings to the storyboard.
[_wtihIosSplashScreenStoryboardImage().withIosSplashScreenImage, splash],
// Link storyboard to xcode project.
// TODO: Maybe fold this into the base mod.
_withIosSplashXcodeProject().withIosSplashXcodeProject,
// Insert the base mod last, no other ios.splashScreenStoryboard mods can be added after this.
_withIosSplashScreenStoryboard().withIosSplashScreenStoryboardBaseMod]);
};
exports.withIosSplashScreen = withIosSplashScreen;
//# sourceMappingURL=withIosSplashScreen.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withIosSplashScreen.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","_getIosSplashConfig","_withIosSplashAssets","_withIosSplashInfoPlist","_withIosSplashScreenStoryboard","_withIosSplashXcodeProject","_wtihIosSplashScreenStoryboardImage","obj","__esModule","default","debug","Debug","withIosSplashScreen","config","splash","getIosSplashConfig","withPlugins","withIosSplashInfoPlist","withIosSplashAssets","withIosSplashScreenImage","withIosSplashXcodeProject","withIosSplashScreenStoryboardBaseMod","exports"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\nimport Debug from 'debug';\n\nimport { getIosSplashConfig, IOSSplashConfig } from './getIosSplashConfig';\nimport { withIosSplashAssets } from './withIosSplashAssets';\nimport { withIosSplashInfoPlist } from './withIosSplashInfoPlist';\nimport { withIosSplashScreenStoryboardBaseMod } from './withIosSplashScreenStoryboard';\nimport { withIosSplashXcodeProject } from './withIosSplashXcodeProject';\nimport { withIosSplashScreenImage } from './wtihIosSplashScreenStoryboardImage';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios');\n\nexport const withIosSplashScreen: ConfigPlugin<IOSSplashConfig | undefined | null | void> = (\n config,\n splash\n) => {\n // If the user didn't specify a splash object, infer the splash object from the Expo config.\n if (!splash) {\n splash = getIosSplashConfig(config);\n } else {\n debug(`custom splash config provided`);\n }\n\n debug(`config:`, splash);\n\n return withPlugins(config, [\n [withIosSplashInfoPlist, splash],\n [withIosSplashAssets, splash],\n // Add the image settings to the storyboard.\n [withIosSplashScreenImage, splash],\n // Link storyboard to xcode project.\n // TODO: Maybe fold this into the base mod.\n withIosSplashXcodeProject,\n // Insert the base mod last, no other ios.splashScreenStoryboard mods can be added after this.\n withIosSplashScreenStoryboardBaseMod,\n ]);\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,oBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,mBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,qBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,oBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,wBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,uBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,+BAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,8BAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,2BAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,0BAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,oCAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,mCAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgF,SAAAG,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhF,MAAMG,KAAK,GAAG,IAAAC,gBAAK,EAAC,6CAA6C,CAAC;AAE3D,MAAMC,mBAA4E,GAAGA,CAC1FC,MAAM,EACNC,MAAM,KACH;EACH;EACA,IAAI,CAACA,MAAM,EAAE;IACXA,MAAM,GAAG,IAAAC,wCAAkB,EAACF,MAAM,CAAC;EACrC,CAAC,MAAM;IACLH,KAAK,CAAC,+BAA+B,CAAC;EACxC;EAEAA,KAAK,CAAC,SAAS,EAAEI,MAAM,CAAC;EAExB,OAAO,IAAAE,4BAAW,EAACH,MAAM,EAAE,CACzB,CAACI,gDAAsB,EAAEH,MAAM,CAAC,EAChC,CAACI,0CAAmB,EAAEJ,MAAM,CAAC;EAC7B;EACA,CAACK,8DAAwB,EAAEL,MAAM,CAAC;EAClC;EACA;EACAM,sDAAyB;EACzB;EACAC,qEAAoC,CACrC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAV,mBAAA,GAAAA,mBAAA","ignoreList":[]}

View File

@@ -0,0 +1,14 @@
import { ConfigPlugin, Mod } from '@expo/config-plugins';
import { IBSplashScreenDocument } from './InterfaceBuilder';
export declare const STORYBOARD_FILE_PATH = "./SplashScreen.storyboard";
/**
* Provides the SplashScreen `.storyboard` xml data for modification.
*
* @param config
* @param action
*/
export declare const withIosSplashScreenStoryboard: ConfigPlugin<Mod<IBSplashScreenDocument>>;
/** Append a custom rule to supply SplashScreen `.storyboard` xml data to mods on `mods.ios.splashScreenStoryboard` */
export declare const withIosSplashScreenStoryboardBaseMod: ConfigPlugin;
/** Get a template splash screen storyboard file. */
export declare function getTemplateAsync(): Promise<IBSplashScreenDocument>;

View File

@@ -0,0 +1,187 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.STORYBOARD_FILE_PATH = void 0;
exports.getTemplateAsync = getTemplateAsync;
exports.withIosSplashScreenStoryboardBaseMod = exports.withIosSplashScreenStoryboard = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function fs() {
const data = _interopRequireWildcard(require("fs"));
fs = function () {
return data;
};
return data;
}
function path() {
const data = _interopRequireWildcard(require("path"));
path = function () {
return data;
};
return data;
}
function _xml2js() {
const data = require("xml2js");
_xml2js = function () {
return data;
};
return data;
}
function _InterfaceBuilder() {
const data = require("./InterfaceBuilder");
_InterfaceBuilder = function () {
return data;
};
return data;
}
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
const STORYBOARD_FILE_PATH = exports.STORYBOARD_FILE_PATH = './SplashScreen.storyboard';
const STORYBOARD_MOD_NAME = 'splashScreenStoryboard';
/**
* Provides the SplashScreen `.storyboard` xml data for modification.
*
* @param config
* @param action
*/
const withIosSplashScreenStoryboard = (config, action) => {
return (0, _configPlugins().withMod)(config, {
platform: 'ios',
mod: STORYBOARD_MOD_NAME,
action
});
};
/** Append a custom rule to supply SplashScreen `.storyboard` xml data to mods on `mods.ios.splashScreenStoryboard` */
exports.withIosSplashScreenStoryboard = withIosSplashScreenStoryboard;
const withIosSplashScreenStoryboardBaseMod = config => {
return _configPlugins().BaseMods.withGeneratedBaseMods(config, {
platform: 'ios',
saveToInternal: true,
skipEmptyMod: false,
providers: {
// Append a custom rule to supply .storyboard xml data to mods on `mods.ios.splashScreenStoryboard`
[STORYBOARD_MOD_NAME]: _configPlugins().BaseMods.provider({
isIntrospective: true,
async getFilePath({
modRequest
}) {
//: [root]/myapp/ios/MyApp/SplashScreen.storyboard
return path().join(
//: myapp/ios
modRequest.platformProjectRoot,
// ./MyApp
modRequest.projectName,
// ./SplashScreen.storyboard
STORYBOARD_FILE_PATH);
},
async read(filePath) {
try {
const contents = await fs().promises.readFile(filePath, 'utf8');
const xml = await new (_xml2js().Parser)().parseStringPromise(contents);
return xml;
} catch {
return getTemplateAsync();
}
},
async write(filePath, {
modResults,
modRequest: {
introspect
}
}) {
if (introspect) {
return;
}
await fs().promises.writeFile(filePath, (0, _InterfaceBuilder().toString)(modResults));
}
})
}
});
};
/** Get a template splash screen storyboard file. */
exports.withIosSplashScreenStoryboardBaseMod = withIosSplashScreenStoryboardBaseMod;
async function getTemplateAsync() {
const contents = `<?xml version="1.0" encoding="UTF-8"?>
<document
type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version="3.0"
toolsVersion="16096"
targetRuntime="iOS.CocoaTouch"
propertyAccessControl="none"
useAutolayout="YES"
launchScreen="YES"
useTraitCollections="YES"
useSafeAreas="YES"
colorMatched="YES"
initialViewController="EXPO-VIEWCONTROLLER-1"
>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<scene sceneID="EXPO-SCENE-1">
<objects>
<viewController
storyboardIdentifier="SplashScreenViewController"
id="EXPO-VIEWCONTROLLER-1"
sceneMemberID="viewController"
>
<view
key="view"
userInteractionEnabled="NO"
contentMode="scaleToFill"
insetsLayoutMarginsFromSafeArea="NO"
id="EXPO-ContainerView"
userLabel="ContainerView"
>
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView
userInteractionEnabled="NO"
contentMode="scaleAspectFill"
horizontalHuggingPriority="251"
verticalHuggingPriority="251"
insetsLayoutMarginsFromSafeArea="NO"
image="SplashScreenBackground"
translatesAutoresizingMaskIntoConstraints="NO"
id="EXPO-SplashScreenBackground"
userLabel="SplashScreenBackground"
>
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="top" secondItem="EXPO-ContainerView" secondAttribute="top" id="1gX-mQ-vu6"/>
<constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="leading" secondItem="EXPO-ContainerView" secondAttribute="leading" id="6tX-OG-Sck"/>
<constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="trailing" secondItem="EXPO-ContainerView" secondAttribute="trailing" id="ABX-8g-7v4"/>
<constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="bottom" secondItem="EXPO-ContainerView" secondAttribute="bottom" id="jkI-2V-eW5"/>
</constraints>
<viewLayoutGuide key="safeArea" id="EXPO-SafeArea"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="EXPO-PLACEHOLDER-1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<resources>
<image name="SplashScreenBackground" width="1" height="1"/>
</resources>
</document>`;
return await new (_xml2js().Parser)().parseStringPromise(contents);
}
//# sourceMappingURL=withIosSplashScreenStoryboard.js.map

View File

@@ -0,0 +1,11 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { XcodeProject } from 'xcode';
export declare const withIosSplashXcodeProject: ConfigPlugin;
/**
* Modifies `.pbxproj` by:
* - adding reference for `.storyboard` file
*/
export declare function setSplashStoryboardAsync({ projectName, project, }: {
projectName: string;
project: XcodeProject;
}): Promise<XcodeProject>;

View File

@@ -0,0 +1,63 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setSplashStoryboardAsync = setSplashStoryboardAsync;
exports.withIosSplashXcodeProject = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _withIosSplashScreenStoryboard() {
const data = require("./withIosSplashScreenStoryboard");
_withIosSplashScreenStoryboard = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const debug = require('debug')('expo:prebuild-config:expo-splash-screen:ios:xcodeproj');
const withIosSplashXcodeProject = config => {
return (0, _configPlugins().withXcodeProject)(config, async config => {
config.modResults = await setSplashStoryboardAsync({
projectName: config.modRequest.projectName,
project: config.modResults
});
return config;
});
};
/**
* Modifies `.pbxproj` by:
* - adding reference for `.storyboard` file
*/
exports.withIosSplashXcodeProject = withIosSplashXcodeProject;
async function setSplashStoryboardAsync({
projectName,
project
}) {
// Check if `${projectName}/SplashScreen.storyboard` already exists
// Path relative to `ios` directory
const storyboardFilePath = _path().default.join(projectName, _withIosSplashScreenStoryboard().STORYBOARD_FILE_PATH);
if (!project.hasFile(storyboardFilePath)) {
debug(`Adding ${storyboardFilePath} to Xcode project`);
_configPlugins().IOSConfig.XcodeUtils.addResourceFileToGroup({
filepath: storyboardFilePath,
groupName: projectName,
project
});
}
return project;
}
//# sourceMappingURL=withIosSplashXcodeProject.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withIosSplashXcodeProject.js","names":["_configPlugins","data","require","_path","_interopRequireDefault","_withIosSplashScreenStoryboard","obj","__esModule","default","debug","withIosSplashXcodeProject","config","withXcodeProject","modResults","setSplashStoryboardAsync","projectName","modRequest","project","exports","storyboardFilePath","path","join","STORYBOARD_FILE_PATH","hasFile","IOSConfig","XcodeUtils","addResourceFileToGroup","filepath","groupName"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withXcodeProject } from '@expo/config-plugins';\nimport path from 'path';\nimport { XcodeProject } from 'xcode';\n\nimport { STORYBOARD_FILE_PATH } from './withIosSplashScreenStoryboard';\n\nconst debug = require('debug')(\n 'expo:prebuild-config:expo-splash-screen:ios:xcodeproj'\n) as typeof console.log;\n\nexport const withIosSplashXcodeProject: ConfigPlugin = (config) => {\n return withXcodeProject(config, async (config) => {\n config.modResults = await setSplashStoryboardAsync({\n projectName: config.modRequest.projectName!,\n project: config.modResults,\n });\n return config;\n });\n};\n\n/**\n * Modifies `.pbxproj` by:\n * - adding reference for `.storyboard` file\n */\nexport async function setSplashStoryboardAsync({\n projectName,\n project,\n}: {\n projectName: string;\n project: XcodeProject;\n}): Promise<XcodeProject> {\n // Check if `${projectName}/SplashScreen.storyboard` already exists\n // Path relative to `ios` directory\n const storyboardFilePath = path.join(projectName, STORYBOARD_FILE_PATH);\n if (!project.hasFile(storyboardFilePath)) {\n debug(`Adding ${storyboardFilePath} to Xcode project`);\n IOSConfig.XcodeUtils.addResourceFileToGroup({\n filepath: storyboardFilePath,\n groupName: projectName,\n project,\n });\n }\n\n return project;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,+BAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,8BAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuE,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvE,MAAMG,KAAK,GAAGP,OAAO,CAAC,OAAO,CAAC,CAC5B,uDACF,CAAuB;AAEhB,MAAMQ,yBAAuC,GAAIC,MAAM,IAAK;EACjE,OAAO,IAAAC,iCAAgB,EAACD,MAAM,EAAE,MAAOA,MAAM,IAAK;IAChDA,MAAM,CAACE,UAAU,GAAG,MAAMC,wBAAwB,CAAC;MACjDC,WAAW,EAAEJ,MAAM,CAACK,UAAU,CAACD,WAAY;MAC3CE,OAAO,EAAEN,MAAM,CAACE;IAClB,CAAC,CAAC;IACF,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AAHAO,OAAA,CAAAR,yBAAA,GAAAA,yBAAA;AAIO,eAAeI,wBAAwBA,CAAC;EAC7CC,WAAW;EACXE;AAIF,CAAC,EAAyB;EACxB;EACA;EACA,MAAME,kBAAkB,GAAGC,eAAI,CAACC,IAAI,CAACN,WAAW,EAAEO,qDAAoB,CAAC;EACvE,IAAI,CAACL,OAAO,CAACM,OAAO,CAACJ,kBAAkB,CAAC,EAAE;IACxCV,KAAK,CAAC,UAAUU,kBAAkB,mBAAmB,CAAC;IACtDK,0BAAS,CAACC,UAAU,CAACC,sBAAsB,CAAC;MAC1CC,QAAQ,EAAER,kBAAkB;MAC5BS,SAAS,EAAEb,WAAW;MACtBE;IACF,CAAC,CAAC;EACJ;EAEA,OAAOA,OAAO;AAChB","ignoreList":[]}

View File

@@ -0,0 +1,5 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { IBSplashScreenDocument } from './InterfaceBuilder';
import { IOSSplashConfig } from './getIosSplashConfig';
export declare const withIosSplashScreenImage: ConfigPlugin<IOSSplashConfig>;
export declare function applySplashScreenStoryboard(obj: IBSplashScreenDocument, splash: IOSSplashConfig): IBSplashScreenDocument;

View File

@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.applySplashScreenStoryboard = applySplashScreenStoryboard;
exports.withIosSplashScreenImage = void 0;
function _InterfaceBuilder() {
const data = require("./InterfaceBuilder");
_InterfaceBuilder = function () {
return data;
};
return data;
}
function _withIosSplashScreenStoryboard() {
const data = require("./withIosSplashScreenStoryboard");
_withIosSplashScreenStoryboard = function () {
return data;
};
return data;
}
const withIosSplashScreenImage = (config, splash) => {
return (0, _withIosSplashScreenStoryboard().withIosSplashScreenStoryboard)(config, config => {
config.modResults = applySplashScreenStoryboard(config.modResults, splash);
return config;
});
};
exports.withIosSplashScreenImage = withIosSplashScreenImage;
function applySplashScreenStoryboard(obj, splash) {
const resizeMode = splash?.resizeMode;
const splashScreenImagePresent = Boolean(splash?.image);
const imageName = 'SplashScreen';
// Only get the resize mode when the image is present.
if (splashScreenImagePresent) {
const contentMode = getImageContentMode(resizeMode || 'contain');
return (0, _InterfaceBuilder().applyImageToSplashScreenXML)(obj, {
contentMode,
imageName
});
}
return (0, _InterfaceBuilder().removeImageFromSplashScreen)(obj, {
imageName
});
}
function getImageContentMode(resizeMode) {
switch (resizeMode) {
case 'contain':
return 'scaleAspectFit';
case 'cover':
return 'scaleAspectFill';
default:
throw new Error(`{ resizeMode: "${resizeMode}" } is not supported for iOS platform.`);
}
}
//# sourceMappingURL=wtihIosSplashScreenStoryboardImage.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"wtihIosSplashScreenStoryboardImage.js","names":["_InterfaceBuilder","data","require","_withIosSplashScreenStoryboard","withIosSplashScreenImage","config","splash","withIosSplashScreenStoryboard","modResults","applySplashScreenStoryboard","exports","obj","resizeMode","splashScreenImagePresent","Boolean","image","imageName","contentMode","getImageContentMode","applyImageToSplashScreenXML","removeImageFromSplashScreen","Error"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.ts"],"sourcesContent":["import { ConfigPlugin } from '@expo/config-plugins';\n\nimport {\n applyImageToSplashScreenXML,\n IBSplashScreenDocument,\n ImageContentMode,\n removeImageFromSplashScreen,\n} from './InterfaceBuilder';\nimport { IOSSplashConfig } from './getIosSplashConfig';\nimport { withIosSplashScreenStoryboard } from './withIosSplashScreenStoryboard';\n\nexport const withIosSplashScreenImage: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n return withIosSplashScreenStoryboard(config, (config) => {\n config.modResults = applySplashScreenStoryboard(config.modResults, splash);\n return config;\n });\n};\n\nexport function applySplashScreenStoryboard(obj: IBSplashScreenDocument, splash: IOSSplashConfig) {\n const resizeMode = splash?.resizeMode;\n const splashScreenImagePresent = Boolean(splash?.image);\n const imageName = 'SplashScreen';\n // Only get the resize mode when the image is present.\n if (splashScreenImagePresent) {\n const contentMode = getImageContentMode(resizeMode || 'contain');\n return applyImageToSplashScreenXML(obj, {\n contentMode,\n imageName,\n });\n }\n\n return removeImageFromSplashScreen(obj, { imageName });\n}\n\nfunction getImageContentMode(resizeMode: string): ImageContentMode {\n switch (resizeMode) {\n case 'contain':\n return 'scaleAspectFit';\n case 'cover':\n return 'scaleAspectFill';\n default:\n throw new Error(`{ resizeMode: \"${resizeMode}\" } is not supported for iOS platform.`);\n }\n}\n"],"mappings":";;;;;;;AAEA,SAAAA,kBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,iBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,+BAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,8BAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,wBAAuD,GAAGA,CAACC,MAAM,EAAEC,MAAM,KAAK;EACzF,OAAO,IAAAC,8DAA6B,EAACF,MAAM,EAAGA,MAAM,IAAK;IACvDA,MAAM,CAACG,UAAU,GAAGC,2BAA2B,CAACJ,MAAM,CAACG,UAAU,EAAEF,MAAM,CAAC;IAC1E,OAAOD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACK,OAAA,CAAAN,wBAAA,GAAAA,wBAAA;AAEK,SAASK,2BAA2BA,CAACE,GAA2B,EAAEL,MAAuB,EAAE;EAChG,MAAMM,UAAU,GAAGN,MAAM,EAAEM,UAAU;EACrC,MAAMC,wBAAwB,GAAGC,OAAO,CAACR,MAAM,EAAES,KAAK,CAAC;EACvD,MAAMC,SAAS,GAAG,cAAc;EAChC;EACA,IAAIH,wBAAwB,EAAE;IAC5B,MAAMI,WAAW,GAAGC,mBAAmB,CAACN,UAAU,IAAI,SAAS,CAAC;IAChE,OAAO,IAAAO,+CAA2B,EAACR,GAAG,EAAE;MACtCM,WAAW;MACXD;IACF,CAAC,CAAC;EACJ;EAEA,OAAO,IAAAI,+CAA2B,EAACT,GAAG,EAAE;IAAEK;EAAU,CAAC,CAAC;AACxD;AAEA,SAASE,mBAAmBA,CAACN,UAAkB,EAAoB;EACjE,QAAQA,UAAU;IAChB,KAAK,SAAS;MACZ,OAAO,gBAAgB;IACzB,KAAK,OAAO;MACV,OAAO,iBAAiB;IAC1B;MACE,MAAM,IAAIS,KAAK,CAAC,kBAAkBT,UAAU,wCAAwC,CAAC;EACzF;AACF","ignoreList":[]}

View File

@@ -0,0 +1,2 @@
declare const _default: import("@expo/config-plugins").ConfigPlugin;
export default _default;

View File

@@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _withAndroidRootViewBackgroundColor() {
const data = require("./withAndroidRootViewBackgroundColor");
_withAndroidRootViewBackgroundColor = function () {
return data;
};
return data;
}
function _withAndroidUserInterfaceStyle() {
const data = require("./withAndroidUserInterfaceStyle");
_withAndroidUserInterfaceStyle = function () {
return data;
};
return data;
}
function _withIosRootViewBackgroundColor() {
const data = require("./withIosRootViewBackgroundColor");
_withIosRootViewBackgroundColor = function () {
return data;
};
return data;
}
function _withIosUserInterfaceStyle() {
const data = require("./withIosUserInterfaceStyle");
_withIosUserInterfaceStyle = function () {
return data;
};
return data;
}
function _createLegacyPlugin() {
const data = require("../createLegacyPlugin");
_createLegacyPlugin = function () {
return data;
};
return data;
}
var _default = exports.default = (0, _createLegacyPlugin().createLegacyPlugin)({
packageName: 'expo-system-ui',
fallback: [_withAndroidRootViewBackgroundColor().withAndroidRootViewBackgroundColor, _withIosRootViewBackgroundColor().withIosRootViewBackgroundColor, _withAndroidUserInterfaceStyle().withAndroidUserInterfaceStyle, _withIosUserInterfaceStyle().withIosUserInterfaceStyle]
});
//# sourceMappingURL=expo-system-ui.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"expo-system-ui.js","names":["_withAndroidRootViewBackgroundColor","data","require","_withAndroidUserInterfaceStyle","_withIosRootViewBackgroundColor","_withIosUserInterfaceStyle","_createLegacyPlugin","_default","exports","default","createLegacyPlugin","packageName","fallback","withAndroidRootViewBackgroundColor","withIosRootViewBackgroundColor","withAndroidUserInterfaceStyle","withIosUserInterfaceStyle"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/expo-system-ui.ts"],"sourcesContent":["import { withAndroidRootViewBackgroundColor } from './withAndroidRootViewBackgroundColor';\nimport { withAndroidUserInterfaceStyle } from './withAndroidUserInterfaceStyle';\nimport { withIosRootViewBackgroundColor } from './withIosRootViewBackgroundColor';\nimport { withIosUserInterfaceStyle } from './withIosUserInterfaceStyle';\nimport { createLegacyPlugin } from '../createLegacyPlugin';\n\nexport default createLegacyPlugin({\n packageName: 'expo-system-ui',\n fallback: [\n withAndroidRootViewBackgroundColor,\n withIosRootViewBackgroundColor,\n withAndroidUserInterfaceStyle,\n withIosUserInterfaceStyle,\n ],\n});\n"],"mappings":";;;;;;AAAA,SAAAA,oCAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,mCAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,+BAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,8BAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gCAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,+BAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,2BAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,0BAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,oBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,mBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2D,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE5C,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,gBAAgB;EAC7BC,QAAQ,EAAE,CACRC,wEAAkC,EAClCC,gEAA8B,EAC9BC,8DAA6B,EAC7BC,sDAAyB;AAE7B,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,6 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
export declare const withAndroidRootViewBackgroundColor: ConfigPlugin;
export declare const withRootViewBackgroundColorColors: ConfigPlugin;
export declare const withRootViewBackgroundColorStyles: ConfigPlugin;
export declare function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'android' | 'backgroundColor'>): string | null;

View File

@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
exports.withRootViewBackgroundColorStyles = exports.withRootViewBackgroundColorColors = exports.withAndroidRootViewBackgroundColor = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
const {
assignColorValue
} = _configPlugins().AndroidConfig.Colors;
const {
assignStylesValue,
getAppThemeLightNoActionBarGroup
} = _configPlugins().AndroidConfig.Styles;
const ANDROID_WINDOW_BACKGROUND = 'android:windowBackground';
const WINDOW_BACKGROUND_COLOR = 'activityBackground';
const withAndroidRootViewBackgroundColor = config => {
config = withRootViewBackgroundColorColors(config);
config = withRootViewBackgroundColorStyles(config);
return config;
};
exports.withAndroidRootViewBackgroundColor = withAndroidRootViewBackgroundColor;
const withRootViewBackgroundColorColors = config => {
return (0, _configPlugins().withAndroidColors)(config, async config => {
config.modResults = assignColorValue(config.modResults, {
value: getRootViewBackgroundColor(config),
name: WINDOW_BACKGROUND_COLOR
});
return config;
});
};
exports.withRootViewBackgroundColorColors = withRootViewBackgroundColorColors;
const withRootViewBackgroundColorStyles = config => {
return (0, _configPlugins().withAndroidStyles)(config, async config => {
config.modResults = assignStylesValue(config.modResults, {
add: !!getRootViewBackgroundColor(config),
parent: getAppThemeLightNoActionBarGroup(),
name: ANDROID_WINDOW_BACKGROUND,
value: `@color/${WINDOW_BACKGROUND_COLOR}`
});
return config;
});
};
exports.withRootViewBackgroundColorStyles = withRootViewBackgroundColorStyles;
function getRootViewBackgroundColor(config) {
return config.android?.backgroundColor || config.backgroundColor || null;
}
//# sourceMappingURL=withAndroidRootViewBackgroundColor.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withAndroidRootViewBackgroundColor.js","names":["_configPlugins","data","require","assignColorValue","AndroidConfig","Colors","assignStylesValue","getAppThemeLightNoActionBarGroup","Styles","ANDROID_WINDOW_BACKGROUND","WINDOW_BACKGROUND_COLOR","withAndroidRootViewBackgroundColor","config","withRootViewBackgroundColorColors","withRootViewBackgroundColorStyles","exports","withAndroidColors","modResults","value","getRootViewBackgroundColor","name","withAndroidStyles","add","parent","android","backgroundColor"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst { assignColorValue } = AndroidConfig.Colors;\nconst { assignStylesValue, getAppThemeLightNoActionBarGroup } = AndroidConfig.Styles;\n\nconst ANDROID_WINDOW_BACKGROUND = 'android:windowBackground';\nconst WINDOW_BACKGROUND_COLOR = 'activityBackground';\n\nexport const withAndroidRootViewBackgroundColor: ConfigPlugin = (config) => {\n config = withRootViewBackgroundColorColors(config);\n config = withRootViewBackgroundColorStyles(config);\n return config;\n};\n\nexport const withRootViewBackgroundColorColors: ConfigPlugin = (config) => {\n return withAndroidColors(config, async (config) => {\n config.modResults = assignColorValue(config.modResults, {\n value: getRootViewBackgroundColor(config),\n name: WINDOW_BACKGROUND_COLOR,\n });\n return config;\n });\n};\n\nexport const withRootViewBackgroundColorStyles: ConfigPlugin = (config) => {\n return withAndroidStyles(config, async (config) => {\n config.modResults = assignStylesValue(config.modResults, {\n add: !!getRootViewBackgroundColor(config),\n parent: getAppThemeLightNoActionBarGroup(),\n name: ANDROID_WINDOW_BACKGROUND,\n value: `@color/${WINDOW_BACKGROUND_COLOR}`,\n });\n return config;\n });\n};\n\nexport function getRootViewBackgroundColor(\n config: Pick<ExpoConfig, 'android' | 'backgroundColor'>\n) {\n return config.android?.backgroundColor || config.backgroundColor || null;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,MAAM;EAAEE;AAAiB,CAAC,GAAGC,8BAAa,CAACC,MAAM;AACjD,MAAM;EAAEC,iBAAiB;EAAEC;AAAiC,CAAC,GAAGH,8BAAa,CAACI,MAAM;AAEpF,MAAMC,yBAAyB,GAAG,0BAA0B;AAC5D,MAAMC,uBAAuB,GAAG,oBAAoB;AAE7C,MAAMC,kCAAgD,GAAIC,MAAM,IAAK;EAC1EA,MAAM,GAAGC,iCAAiC,CAACD,MAAM,CAAC;EAClDA,MAAM,GAAGE,iCAAiC,CAACF,MAAM,CAAC;EAClD,OAAOA,MAAM;AACf,CAAC;AAACG,OAAA,CAAAJ,kCAAA,GAAAA,kCAAA;AAEK,MAAME,iCAA+C,GAAID,MAAM,IAAK;EACzE,OAAO,IAAAI,kCAAiB,EAACJ,MAAM,EAAE,MAAOA,MAAM,IAAK;IACjDA,MAAM,CAACK,UAAU,GAAGd,gBAAgB,CAACS,MAAM,CAACK,UAAU,EAAE;MACtDC,KAAK,EAAEC,0BAA0B,CAACP,MAAM,CAAC;MACzCQ,IAAI,EAAEV;IACR,CAAC,CAAC;IACF,OAAOE,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACG,OAAA,CAAAF,iCAAA,GAAAA,iCAAA;AAEK,MAAMC,iCAA+C,GAAIF,MAAM,IAAK;EACzE,OAAO,IAAAS,kCAAiB,EAACT,MAAM,EAAE,MAAOA,MAAM,IAAK;IACjDA,MAAM,CAACK,UAAU,GAAGX,iBAAiB,CAACM,MAAM,CAACK,UAAU,EAAE;MACvDK,GAAG,EAAE,CAAC,CAACH,0BAA0B,CAACP,MAAM,CAAC;MACzCW,MAAM,EAAEhB,gCAAgC,CAAC,CAAC;MAC1Ca,IAAI,EAAEX,yBAAyB;MAC/BS,KAAK,EAAE,UAAUR,uBAAuB;IAC1C,CAAC,CAAC;IACF,OAAOE,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACG,OAAA,CAAAD,iCAAA,GAAAA,iCAAA;AAEK,SAASK,0BAA0BA,CACxCP,MAAuD,EACvD;EACA,OAAOA,MAAM,CAACY,OAAO,EAAEC,eAAe,IAAIb,MAAM,CAACa,eAAe,IAAI,IAAI;AAC1E","ignoreList":[]}

View File

@@ -0,0 +1,2 @@
import { ConfigPlugin } from '@expo/config-plugins';
export declare const withAndroidUserInterfaceStyle: ConfigPlugin<void>;

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.withAndroidUserInterfaceStyle = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
const withAndroidUserInterfaceStyle = config => {
return (0, _configPlugins().withStringsXml)(config, config => {
const userInterfaceStyle = config.android?.userInterfaceStyle ?? config.userInterfaceStyle;
if (userInterfaceStyle) {
_configPlugins().WarningAggregator.addWarningAndroid('userInterfaceStyle',
// TODO: Maybe warn that they need a certain version of React Native as well?
'Install expo-system-ui in your project to enable this feature.');
}
return config;
});
};
exports.withAndroidUserInterfaceStyle = withAndroidUserInterfaceStyle;
//# sourceMappingURL=withAndroidUserInterfaceStyle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withAndroidUserInterfaceStyle.js","names":["_configPlugins","data","require","withAndroidUserInterfaceStyle","config","withStringsXml","userInterfaceStyle","android","WarningAggregator","addWarningAndroid","exports"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withStringsXml } from '@expo/config-plugins';\n\nexport const withAndroidUserInterfaceStyle: ConfigPlugin<void> = (config) => {\n return withStringsXml(config, (config) => {\n const userInterfaceStyle = config.android?.userInterfaceStyle ?? config.userInterfaceStyle;\n if (userInterfaceStyle) {\n WarningAggregator.addWarningAndroid(\n 'userInterfaceStyle',\n // TODO: Maybe warn that they need a certain version of React Native as well?\n 'Install expo-system-ui in your project to enable this feature.'\n );\n }\n\n return config;\n });\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,6BAAiD,GAAIC,MAAM,IAAK;EAC3E,OAAO,IAAAC,+BAAc,EAACD,MAAM,EAAGA,MAAM,IAAK;IACxC,MAAME,kBAAkB,GAAGF,MAAM,CAACG,OAAO,EAAED,kBAAkB,IAAIF,MAAM,CAACE,kBAAkB;IAC1F,IAAIA,kBAAkB,EAAE;MACtBE,kCAAiB,CAACC,iBAAiB,CACjC,oBAAoB;MACpB;MACA,gEACF,CAAC;IACH;IAEA,OAAOL,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACM,OAAA,CAAAP,6BAAA,GAAAA,6BAAA","ignoreList":[]}

View File

@@ -0,0 +1,8 @@
import { ConfigPlugin, InfoPlist } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
export declare const withIosRootViewBackgroundColor: ConfigPlugin;
/** The template was changed in SDK 43 to move the background color logic to the `expo-system-ui` module */
export declare function shouldUseLegacyBehavior(config: Pick<ExpoConfig, 'sdkVersion'>): boolean;
export declare function warnSystemUIMissing(config: Pick<ExpoConfig, 'sdkVersion' | 'backgroundColor' | 'ios'>): void;
export declare function setRootViewBackgroundColor(config: Pick<ExpoConfig, 'backgroundColor' | 'ios'>, infoPlist: InfoPlist): InfoPlist;
export declare function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'ios' | 'backgroundColor'>): string | null;

View File

@@ -0,0 +1,83 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
exports.setRootViewBackgroundColor = setRootViewBackgroundColor;
exports.shouldUseLegacyBehavior = shouldUseLegacyBehavior;
exports.warnSystemUIMissing = warnSystemUIMissing;
exports.withIosRootViewBackgroundColor = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _normalizeColors() {
const data = _interopRequireDefault(require("@react-native/normalize-colors"));
_normalizeColors = function () {
return data;
};
return data;
}
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// @ts-ignore: uses flow
// Maps to the template AppDelegate.m
const BACKGROUND_COLOR_KEY = 'RCTRootViewBackgroundColor';
const debug = require('debug')('expo:system-ui:plugin:ios');
const withIosRootViewBackgroundColor = config => {
config = (0, _configPlugins().withInfoPlist)(config, config => {
if (shouldUseLegacyBehavior(config)) {
config.modResults = setRootViewBackgroundColor(config, config.modResults);
} else {
warnSystemUIMissing(config);
}
return config;
});
return config;
};
/** The template was changed in SDK 43 to move the background color logic to the `expo-system-ui` module */
exports.withIosRootViewBackgroundColor = withIosRootViewBackgroundColor;
function shouldUseLegacyBehavior(config) {
try {
return !!(config.sdkVersion && _semver().default.lt(config.sdkVersion, '44.0.0'));
} catch {}
return false;
}
function warnSystemUIMissing(config) {
const backgroundColor = getRootViewBackgroundColor(config);
if (backgroundColor) {
// Background color needs to be set programmatically
_configPlugins().WarningAggregator.addWarningIOS('ios.backgroundColor', 'Install expo-system-ui to enable this feature', 'https://docs.expo.dev/build-reference/migrating/#expo-config--backgroundcolor--depends-on');
}
}
function setRootViewBackgroundColor(config, infoPlist) {
const backgroundColor = getRootViewBackgroundColor(config);
if (!backgroundColor) {
delete infoPlist[BACKGROUND_COLOR_KEY];
} else {
let color = (0, _normalizeColors().default)(backgroundColor);
if (!color) {
throw new Error('Invalid background color on iOS');
}
color = (color << 24 | color >>> 8) >>> 0;
infoPlist[BACKGROUND_COLOR_KEY] = color;
debug(`Convert color: ${backgroundColor} -> ${color}`);
}
return infoPlist;
}
function getRootViewBackgroundColor(config) {
return config.ios?.backgroundColor || config.backgroundColor || null;
}
//# sourceMappingURL=withIosRootViewBackgroundColor.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withIosRootViewBackgroundColor.js","names":["_configPlugins","data","require","_normalizeColors","_interopRequireDefault","_semver","obj","__esModule","default","BACKGROUND_COLOR_KEY","debug","withIosRootViewBackgroundColor","config","withInfoPlist","shouldUseLegacyBehavior","modResults","setRootViewBackgroundColor","warnSystemUIMissing","exports","sdkVersion","semver","lt","backgroundColor","getRootViewBackgroundColor","WarningAggregator","addWarningIOS","infoPlist","color","normalizeColor","Error","ios"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, WarningAggregator, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n// @ts-ignore: uses flow\nimport normalizeColor from '@react-native/normalize-colors';\nimport semver from 'semver';\n\n// Maps to the template AppDelegate.m\nconst BACKGROUND_COLOR_KEY = 'RCTRootViewBackgroundColor';\n\nconst debug = require('debug')('expo:system-ui:plugin:ios');\n\nexport const withIosRootViewBackgroundColor: ConfigPlugin = (config) => {\n config = withInfoPlist(config, (config) => {\n if (shouldUseLegacyBehavior(config)) {\n config.modResults = setRootViewBackgroundColor(config, config.modResults);\n } else {\n warnSystemUIMissing(config);\n }\n return config;\n });\n return config;\n};\n\n/** The template was changed in SDK 43 to move the background color logic to the `expo-system-ui` module */\nexport function shouldUseLegacyBehavior(config: Pick<ExpoConfig, 'sdkVersion'>): boolean {\n try {\n return !!(config.sdkVersion && semver.lt(config.sdkVersion, '44.0.0'));\n } catch {}\n return false;\n}\n\nexport function warnSystemUIMissing(\n config: Pick<ExpoConfig, 'sdkVersion' | 'backgroundColor' | 'ios'>\n) {\n const backgroundColor = getRootViewBackgroundColor(config);\n\n if (backgroundColor) {\n // Background color needs to be set programmatically\n WarningAggregator.addWarningIOS(\n 'ios.backgroundColor',\n 'Install expo-system-ui to enable this feature',\n 'https://docs.expo.dev/build-reference/migrating/#expo-config--backgroundcolor--depends-on'\n );\n }\n}\n\nexport function setRootViewBackgroundColor(\n config: Pick<ExpoConfig, 'backgroundColor' | 'ios'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const backgroundColor = getRootViewBackgroundColor(config);\n if (!backgroundColor) {\n delete infoPlist[BACKGROUND_COLOR_KEY];\n } else {\n let color = normalizeColor(backgroundColor);\n if (!color) {\n throw new Error('Invalid background color on iOS');\n }\n color = ((color << 24) | (color >>> 8)) >>> 0;\n infoPlist[BACKGROUND_COLOR_KEY] = color;\n\n debug(`Convert color: ${backgroundColor} -> ${color}`);\n }\n return infoPlist;\n}\n\nexport function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'ios' | 'backgroundColor'>) {\n return config.ios?.backgroundColor || config.backgroundColor || null;\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,iBAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAF5B;;AAIA;AACA,MAAMG,oBAAoB,GAAG,4BAA4B;AAEzD,MAAMC,KAAK,GAAGR,OAAO,CAAC,OAAO,CAAC,CAAC,2BAA2B,CAAC;AAEpD,MAAMS,8BAA4C,GAAIC,MAAM,IAAK;EACtEA,MAAM,GAAG,IAAAC,8BAAa,EAACD,MAAM,EAAGA,MAAM,IAAK;IACzC,IAAIE,uBAAuB,CAACF,MAAM,CAAC,EAAE;MACnCA,MAAM,CAACG,UAAU,GAAGC,0BAA0B,CAACJ,MAAM,EAAEA,MAAM,CAACG,UAAU,CAAC;IAC3E,CAAC,MAAM;MACLE,mBAAmB,CAACL,MAAM,CAAC;IAC7B;IACA,OAAOA,MAAM;EACf,CAAC,CAAC;EACF,OAAOA,MAAM;AACf,CAAC;;AAED;AAAAM,OAAA,CAAAP,8BAAA,GAAAA,8BAAA;AACO,SAASG,uBAAuBA,CAACF,MAAsC,EAAW;EACvF,IAAI;IACF,OAAO,CAAC,EAAEA,MAAM,CAACO,UAAU,IAAIC,iBAAM,CAACC,EAAE,CAACT,MAAM,CAACO,UAAU,EAAE,QAAQ,CAAC,CAAC;EACxE,CAAC,CAAC,MAAM,CAAC;EACT,OAAO,KAAK;AACd;AAEO,SAASF,mBAAmBA,CACjCL,MAAkE,EAClE;EACA,MAAMU,eAAe,GAAGC,0BAA0B,CAACX,MAAM,CAAC;EAE1D,IAAIU,eAAe,EAAE;IACnB;IACAE,kCAAiB,CAACC,aAAa,CAC7B,qBAAqB,EACrB,+CAA+C,EAC/C,2FACF,CAAC;EACH;AACF;AAEO,SAAST,0BAA0BA,CACxCJ,MAAmD,EACnDc,SAAoB,EACT;EACX,MAAMJ,eAAe,GAAGC,0BAA0B,CAACX,MAAM,CAAC;EAC1D,IAAI,CAACU,eAAe,EAAE;IACpB,OAAOI,SAAS,CAACjB,oBAAoB,CAAC;EACxC,CAAC,MAAM;IACL,IAAIkB,KAAK,GAAG,IAAAC,0BAAc,EAACN,eAAe,CAAC;IAC3C,IAAI,CAACK,KAAK,EAAE;MACV,MAAM,IAAIE,KAAK,CAAC,iCAAiC,CAAC;IACpD;IACAF,KAAK,GAAG,CAAEA,KAAK,IAAI,EAAE,GAAKA,KAAK,KAAK,CAAE,MAAM,CAAC;IAC7CD,SAAS,CAACjB,oBAAoB,CAAC,GAAGkB,KAAK;IAEvCjB,KAAK,CAAC,kBAAkBY,eAAe,OAAOK,KAAK,EAAE,CAAC;EACxD;EACA,OAAOD,SAAS;AAClB;AAEO,SAASH,0BAA0BA,CAACX,MAAmD,EAAE;EAC9F,OAAOA,MAAM,CAACkB,GAAG,EAAER,eAAe,IAAIV,MAAM,CAACU,eAAe,IAAI,IAAI;AACtE","ignoreList":[]}

View File

@@ -0,0 +1,5 @@
import { InfoPlist } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
export declare const withIosUserInterfaceStyle: import("@expo/config-plugins").ConfigPlugin;
export declare function getUserInterfaceStyle(config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>): string;
export declare function setUserInterfaceStyle(config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>, { UIUserInterfaceStyle, ...infoPlist }: InfoPlist): InfoPlist;

View File

@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getUserInterfaceStyle = getUserInterfaceStyle;
exports.setUserInterfaceStyle = setUserInterfaceStyle;
exports.withIosUserInterfaceStyle = void 0;
function _iosPlugins() {
const data = require("@expo/config-plugins/build/plugins/ios-plugins");
_iosPlugins = function () {
return data;
};
return data;
}
const withIosUserInterfaceStyle = exports.withIosUserInterfaceStyle = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setUserInterfaceStyle, {
infoPlistProperty: 'UIUserInterfaceStyle',
expoConfigProperty: 'userInterfaceStyle | ios.userInterfaceStyle',
expoPropertyGetter: getUserInterfaceStyle
}, 'withIosUserInterfaceStyle');
function getUserInterfaceStyle(config) {
return config.ios?.userInterfaceStyle ?? config.userInterfaceStyle ?? 'light';
}
function setUserInterfaceStyle(config, {
UIUserInterfaceStyle,
...infoPlist
}) {
const userInterfaceStyle = getUserInterfaceStyle(config);
const style = mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);
if (!style) {
return infoPlist;
}
return {
...infoPlist,
UIUserInterfaceStyle: style
};
}
function mapUserInterfaceStyleForInfoPlist(userInterfaceStyle) {
switch (userInterfaceStyle) {
case 'light':
return 'Light';
case 'dark':
return 'Dark';
case 'automatic':
return 'Automatic';
}
return null;
}
//# sourceMappingURL=withIosUserInterfaceStyle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withIosUserInterfaceStyle.js","names":["_iosPlugins","data","require","withIosUserInterfaceStyle","exports","createInfoPlistPluginWithPropertyGuard","setUserInterfaceStyle","infoPlistProperty","expoConfigProperty","expoPropertyGetter","getUserInterfaceStyle","config","ios","userInterfaceStyle","UIUserInterfaceStyle","infoPlist","style","mapUserInterfaceStyleForInfoPlist"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.ts"],"sourcesContent":["import { InfoPlist } from '@expo/config-plugins';\nimport { createInfoPlistPluginWithPropertyGuard } from '@expo/config-plugins/build/plugins/ios-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withIosUserInterfaceStyle = createInfoPlistPluginWithPropertyGuard(\n setUserInterfaceStyle,\n {\n infoPlistProperty: 'UIUserInterfaceStyle',\n expoConfigProperty: 'userInterfaceStyle | ios.userInterfaceStyle',\n expoPropertyGetter: getUserInterfaceStyle,\n },\n 'withIosUserInterfaceStyle'\n);\n\nexport function getUserInterfaceStyle(\n config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>\n): string {\n return config.ios?.userInterfaceStyle ?? config.userInterfaceStyle ?? 'light';\n}\n\nexport function setUserInterfaceStyle(\n config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>,\n { UIUserInterfaceStyle, ...infoPlist }: InfoPlist\n): InfoPlist {\n const userInterfaceStyle = getUserInterfaceStyle(config);\n const style = mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);\n\n if (!style) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n UIUserInterfaceStyle: style,\n };\n}\n\nfunction mapUserInterfaceStyleForInfoPlist(\n userInterfaceStyle: string\n): NonNullable<InfoPlist['UIUserInterfaceStyle']> | null {\n switch (userInterfaceStyle) {\n case 'light':\n return 'Light';\n case 'dark':\n return 'Dark';\n case 'automatic':\n return 'Automatic';\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAME,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GAAG,IAAAE,oDAAsC,EAC7EC,qBAAqB,EACrB;EACEC,iBAAiB,EAAE,sBAAsB;EACzCC,kBAAkB,EAAE,6CAA6C;EACjEC,kBAAkB,EAAEC;AACtB,CAAC,EACD,2BACF,CAAC;AAEM,SAASA,qBAAqBA,CACnCC,MAAsD,EAC9C;EACR,OAAOA,MAAM,CAACC,GAAG,EAAEC,kBAAkB,IAAIF,MAAM,CAACE,kBAAkB,IAAI,OAAO;AAC/E;AAEO,SAASP,qBAAqBA,CACnCK,MAAsD,EACtD;EAAEG,oBAAoB;EAAE,GAAGC;AAAqB,CAAC,EACtC;EACX,MAAMF,kBAAkB,GAAGH,qBAAqB,CAACC,MAAM,CAAC;EACxD,MAAMK,KAAK,GAAGC,iCAAiC,CAACJ,kBAAkB,CAAC;EAEnE,IAAI,CAACG,KAAK,EAAE;IACV,OAAOD,SAAS;EAClB;EAEA,OAAO;IACL,GAAGA,SAAS;IACZD,oBAAoB,EAAEE;EACxB,CAAC;AACH;AAEA,SAASC,iCAAiCA,CACxCJ,kBAA0B,EAC6B;EACvD,QAAQA,kBAAkB;IACxB,KAAK,OAAO;MACV,OAAO,OAAO;IAChB,KAAK,MAAM;MACT,OAAO,MAAM;IACf,KAAK,WAAW;MACd,OAAO,WAAW;EACtB;EAEA,OAAO,IAAI;AACb","ignoreList":[]}

View File

@@ -0,0 +1,3 @@
import { ConfigPlugin } from '@expo/config-plugins';
export declare const withExpoUpdates: ConfigPlugin;
export default withExpoUpdates;

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.withExpoUpdates = exports.default = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
// Local unversioned updates plugin
const packageName = 'expo-updates';
const withExpoUpdates = config => {
return (0, _configPlugins().withStaticPlugin)(config, {
_isLegacyPlugin: true,
// Pass props to the static plugin if it exists.
plugin: packageName,
// If the static plugin isn't found, use the unversioned one.
fallback: (0, _configPlugins().createRunOncePlugin)(config => withUnversionedUpdates(config), packageName)
});
};
exports.withExpoUpdates = withExpoUpdates;
const withUnversionedUpdates = config => {
config = _configPlugins().AndroidConfig.Updates.withUpdates(config);
config = _configPlugins().IOSConfig.Updates.withUpdates(config);
return config;
};
var _default = exports.default = withExpoUpdates;
//# sourceMappingURL=expo-updates.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"expo-updates.js","names":["_configPlugins","data","require","packageName","withExpoUpdates","config","withStaticPlugin","_isLegacyPlugin","plugin","fallback","createRunOncePlugin","withUnversionedUpdates","exports","AndroidConfig","Updates","withUpdates","IOSConfig","_default","default"],"sources":["../../../src/plugins/unversioned/expo-updates.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n createRunOncePlugin,\n IOSConfig,\n withStaticPlugin,\n} from '@expo/config-plugins';\n\n// Local unversioned updates plugin\n\nconst packageName = 'expo-updates';\n\nexport const withExpoUpdates: ConfigPlugin = (config) => {\n return withStaticPlugin(config, {\n _isLegacyPlugin: true,\n // Pass props to the static plugin if it exists.\n plugin: packageName,\n // If the static plugin isn't found, use the unversioned one.\n fallback: createRunOncePlugin((config) => withUnversionedUpdates(config), packageName),\n });\n};\n\nconst withUnversionedUpdates: ConfigPlugin = (config) => {\n config = AndroidConfig.Updates.withUpdates(config);\n config = IOSConfig.Updates.withUpdates(config);\n return config;\n};\n\nexport default withExpoUpdates;\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA;;AAEA,MAAME,WAAW,GAAG,cAAc;AAE3B,MAAMC,eAA6B,GAAIC,MAAM,IAAK;EACvD,OAAO,IAAAC,iCAAgB,EAACD,MAAM,EAAE;IAC9BE,eAAe,EAAE,IAAI;IACrB;IACAC,MAAM,EAAEL,WAAW;IACnB;IACAM,QAAQ,EAAE,IAAAC,oCAAmB,EAAEL,MAAM,IAAKM,sBAAsB,CAACN,MAAM,CAAC,EAAEF,WAAW;EACvF,CAAC,CAAC;AACJ,CAAC;AAACS,OAAA,CAAAR,eAAA,GAAAA,eAAA;AAEF,MAAMO,sBAAoC,GAAIN,MAAM,IAAK;EACvDA,MAAM,GAAGQ,8BAAa,CAACC,OAAO,CAACC,WAAW,CAACV,MAAM,CAAC;EAClDA,MAAM,GAAGW,0BAAS,CAACF,OAAO,CAACC,WAAW,CAACV,MAAM,CAAC;EAC9C,OAAOA,MAAM;AACf,CAAC;AAAC,IAAAY,QAAA,GAAAL,OAAA,CAAAM,OAAA,GAEad,eAAe","ignoreList":[]}

View File

@@ -0,0 +1,3 @@
import { ConfigPlugin } from '@expo/config-plugins';
declare const _default: ConfigPlugin;
export default _default;

Some files were not shown because too many files have changed in this diff Show More