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,6 @@
import { ConfigPlugin, ExportedConfigWithProps, AndroidConfig } from '@expo/config-plugins';
import { type ExpoConfig } from '@expo/config-types';
export type ResourceXMLConfig = ExportedConfigWithProps<AndroidConfig.Resources.ResourceXML>;
export declare const withEdgeToEdge: ConfigPlugin;
export declare function applyEdgeToEdge(config: ExpoConfig): ExpoConfig;
export default withEdgeToEdge;

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.applyEdgeToEdge = applyEdgeToEdge;
exports.withEdgeToEdge = exports.default = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _withRestoreDefaultTheme() {
const data = require("./withRestoreDefaultTheme");
_withRestoreDefaultTheme = function () {
return data;
};
return data;
}
const TAG = 'EDGE_TO_EDGE_PLUGIN';
const withEdgeToEdge = config => {
return applyEdgeToEdge(config);
};
exports.withEdgeToEdge = withEdgeToEdge;
function applyEdgeToEdge(config) {
if ('edgeToEdgeEnabled' in (config.android ?? {})) {
_configPlugins().WarningAggregator.addWarningAndroid(TAG, '`edgeToEdgeEnabled` customization is no longer available - Android 16 makes edge-to-edge mandatory. Remove the `edgeToEdgeEnabled` entry from your app.json/app.config.js.');
}
// We always restore the default theme in case the project has a leftover react-native-edge-to-edge theme from SDK 53.
// If they are using react-native-edge-to-edge config plugin it'll be reapplied later.
return (0, _withRestoreDefaultTheme().withRestoreDefaultTheme)(config);
}
var _default = exports.default = withEdgeToEdge;
//# sourceMappingURL=withEdgeToEdge.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withEdgeToEdge.js","names":["_configPlugins","data","require","_withRestoreDefaultTheme","TAG","withEdgeToEdge","config","applyEdgeToEdge","exports","android","WarningAggregator","addWarningAndroid","withRestoreDefaultTheme","_default","default"],"sources":["../../../../src/plugins/unversioned/edge-to-edge/withEdgeToEdge.ts"],"sourcesContent":["import {\n ConfigPlugin,\n ExportedConfigWithProps,\n WarningAggregator,\n AndroidConfig,\n} from '@expo/config-plugins';\nimport { type ExpoConfig } from '@expo/config-types';\n\nimport { withRestoreDefaultTheme } from './withRestoreDefaultTheme';\n\nconst TAG = 'EDGE_TO_EDGE_PLUGIN';\n\nexport type ResourceXMLConfig = ExportedConfigWithProps<AndroidConfig.Resources.ResourceXML>;\n\nexport const withEdgeToEdge: ConfigPlugin = (config) => {\n return applyEdgeToEdge(config);\n};\n\nexport function applyEdgeToEdge(config: ExpoConfig): ExpoConfig {\n if ('edgeToEdgeEnabled' in (config.android ?? {})) {\n WarningAggregator.addWarningAndroid(\n TAG,\n '`edgeToEdgeEnabled` customization is no longer available - Android 16 makes edge-to-edge mandatory. Remove the `edgeToEdgeEnabled` entry from your app.json/app.config.js.'\n );\n }\n\n // We always restore the default theme in case the project has a leftover react-native-edge-to-edge theme from SDK 53.\n // If they are using react-native-edge-to-edge config plugin it'll be reapplied later.\n return withRestoreDefaultTheme(config);\n}\n\nexport default withEdgeToEdge;\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAE,yBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,wBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,GAAG,GAAG,qBAAqB;AAI1B,MAAMC,cAA4B,GAAIC,MAAM,IAAK;EACtD,OAAOC,eAAe,CAACD,MAAM,CAAC;AAChC,CAAC;AAACE,OAAA,CAAAH,cAAA,GAAAA,cAAA;AAEK,SAASE,eAAeA,CAACD,MAAkB,EAAc;EAC9D,IAAI,mBAAmB,KAAKA,MAAM,CAACG,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE;IACjDC,kCAAiB,CAACC,iBAAiB,CACjCP,GAAG,EACH,4KACF,CAAC;EACH;;EAEA;EACA;EACA,OAAO,IAAAQ,kDAAuB,EAACN,MAAM,CAAC;AACxC;AAAC,IAAAO,QAAA,GAAAL,OAAA,CAAAM,OAAA,GAEcT,cAAc","ignoreList":[]}

View File

@@ -0,0 +1,4 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { ResourceXMLConfig } from './withEdgeToEdge';
export declare const withRestoreDefaultTheme: ConfigPlugin;
export declare function restoreDefaultTheme(config: ResourceXMLConfig): ResourceXMLConfig;

View File

@@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.restoreDefaultTheme = restoreDefaultTheme;
exports.withRestoreDefaultTheme = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
const withRestoreDefaultTheme = config => {
// Default theme for SDK 53 and onwards projects
return (0, _configPlugins().withAndroidStyles)(config, config => {
return restoreDefaultTheme(config);
});
};
exports.withRestoreDefaultTheme = withRestoreDefaultTheme;
function restoreDefaultTheme(config) {
const DEFAULT_THEME = 'Theme.AppCompat.DayNight.NoActionBar';
const {
style = []
} = config.modResults.resources;
const mainThemeIndex = style.findIndex(({
$
}) => $.name === 'AppTheme');
if (mainThemeIndex === -1) {
return config;
}
if (style[mainThemeIndex].$?.parent.includes('EdgeToEdge')) {
config.modResults.resources.style = [{
$: {
name: 'AppTheme',
parent: DEFAULT_THEME
},
item: style[mainThemeIndex].item
}, ...style.filter(({
$
}) => $.name !== 'AppTheme')];
}
return config;
}
//# sourceMappingURL=withRestoreDefaultTheme.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withRestoreDefaultTheme.js","names":["_configPlugins","data","require","withRestoreDefaultTheme","config","withAndroidStyles","restoreDefaultTheme","exports","DEFAULT_THEME","style","modResults","resources","mainThemeIndex","findIndex","$","name","parent","includes","item","filter"],"sources":["../../../../src/plugins/unversioned/edge-to-edge/withRestoreDefaultTheme.ts"],"sourcesContent":["import { ConfigPlugin, withAndroidStyles } from '@expo/config-plugins';\n\nimport { ResourceXMLConfig } from './withEdgeToEdge';\n\nexport const withRestoreDefaultTheme: ConfigPlugin = (config) => {\n // Default theme for SDK 53 and onwards projects\n return withAndroidStyles(config, (config) => {\n return restoreDefaultTheme(config);\n });\n};\n\nexport function restoreDefaultTheme(config: ResourceXMLConfig): ResourceXMLConfig {\n const DEFAULT_THEME = 'Theme.AppCompat.DayNight.NoActionBar';\n\n const { style = [] } = config.modResults.resources;\n const mainThemeIndex = style.findIndex(({ $ }) => $.name === 'AppTheme');\n if (mainThemeIndex === -1) {\n return config;\n }\n\n if (style[mainThemeIndex].$?.parent.includes('EdgeToEdge')) {\n config.modResults.resources.style = [\n {\n $: {\n name: 'AppTheme',\n parent: DEFAULT_THEME,\n },\n item: style[mainThemeIndex].item,\n },\n ...style.filter(({ $ }) => $.name !== 'AppTheme'),\n ];\n }\n return config;\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,uBAAqC,GAAIC,MAAM,IAAK;EAC/D;EACA,OAAO,IAAAC,kCAAiB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC3C,OAAOE,mBAAmB,CAACF,MAAM,CAAC;EACpC,CAAC,CAAC;AACJ,CAAC;AAACG,OAAA,CAAAJ,uBAAA,GAAAA,uBAAA;AAEK,SAASG,mBAAmBA,CAACF,MAAyB,EAAqB;EAChF,MAAMI,aAAa,GAAG,sCAAsC;EAE5D,MAAM;IAAEC,KAAK,GAAG;EAAG,CAAC,GAAGL,MAAM,CAACM,UAAU,CAACC,SAAS;EAClD,MAAMC,cAAc,GAAGH,KAAK,CAACI,SAAS,CAAC,CAAC;IAAEC;EAAE,CAAC,KAAKA,CAAC,CAACC,IAAI,KAAK,UAAU,CAAC;EACxE,IAAIH,cAAc,KAAK,CAAC,CAAC,EAAE;IACzB,OAAOR,MAAM;EACf;EAEA,IAAIK,KAAK,CAACG,cAAc,CAAC,CAACE,CAAC,EAAEE,MAAM,CAACC,QAAQ,CAAC,YAAY,CAAC,EAAE;IAC1Db,MAAM,CAACM,UAAU,CAACC,SAAS,CAACF,KAAK,GAAG,CAClC;MACEK,CAAC,EAAE;QACDC,IAAI,EAAE,UAAU;QAChBC,MAAM,EAAER;MACV,CAAC;MACDU,IAAI,EAAET,KAAK,CAACG,cAAc,CAAC,CAACM;IAC9B,CAAC,EACD,GAAGT,KAAK,CAACU,MAAM,CAAC,CAAC;MAAEL;IAAE,CAAC,KAAKA,CAAC,CAACC,IAAI,KAAK,UAAU,CAAC,CAClD;EACH;EACA,OAAOX,MAAM;AACf","ignoreList":[]}