first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

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,
getAppThemeGroup
} = _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: getAppThemeGroup(),
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","getAppThemeGroup","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, getAppThemeGroup } = 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: getAppThemeGroup(),\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?.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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(e) { return e && e.__esModule ? e : { default: e }; }
// @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","e","__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,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAF5B;;AAIA;AACA,MAAMG,oBAAoB,GAAG,4BAA4B;AAEzD,MAAMC,KAAK,GAAGR,OAAO,CAAC,OAAO,CAAC,CAAC,2BAA2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,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":[]}