@expo/config-plugins 4.0.2 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/build/Plugin.types.d.ts +4 -0
- package/build/Plugin.types.js.map +1 -1
- package/build/android/Updates.d.ts +10 -10
- package/build/android/Updates.js.map +1 -1
- package/build/android/codeMod.d.ts +20 -0
- package/build/android/codeMod.js +109 -0
- package/build/android/codeMod.js.map +1 -0
- package/build/android/index.d.ts +2 -6
- package/build/android/index.js +1 -86
- package/build/android/index.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/ios/Bitcode.d.ts +33 -0
- package/build/ios/Bitcode.js +131 -0
- package/build/ios/Bitcode.js.map +1 -0
- package/build/ios/Maps.js +1 -0
- package/build/ios/Maps.js.map +1 -1
- package/build/ios/Paths.d.ts +1 -0
- package/build/ios/Paths.js +25 -0
- package/build/ios/Paths.js.map +1 -1
- package/build/ios/Updates.d.ts +10 -10
- package/build/ios/Updates.js.map +1 -1
- package/build/ios/codeMod.d.ts +81 -0
- package/build/ios/codeMod.js +306 -0
- package/build/ios/codeMod.js.map +1 -0
- package/build/ios/index.d.ts +3 -5
- package/build/ios/index.js +6 -57
- package/build/ios/index.js.map +1 -1
- package/build/plugins/android-plugins.d.ts +7 -0
- package/build/plugins/android-plugins.js +19 -2
- package/build/plugins/android-plugins.js.map +1 -1
- package/build/plugins/ios-plugins.d.ts +6 -6
- package/build/plugins/ios-plugins.js.map +1 -1
- package/build/plugins/withAndroidBaseMods.d.ts +2 -0
- package/build/plugins/withAndroidBaseMods.js +32 -0
- package/build/plugins/withAndroidBaseMods.js.map +1 -1
- package/build/plugins/withStaticPlugin.js +16 -5
- package/build/plugins/withStaticPlugin.js.map +1 -1
- package/build/utils/Updates.d.ts +5 -4
- package/build/utils/Updates.js +1 -1
- package/build/utils/Updates.js.map +1 -1
- package/build/utils/commonCodeMod.d.ts +32 -0
- package/build/utils/commonCodeMod.js +71 -0
- package/build/utils/commonCodeMod.js.map +1 -0
- package/build/utils/matchBrackets.d.ts +7 -0
- package/build/utils/matchBrackets.js +80 -0
- package/build/utils/matchBrackets.js.map +1 -0
- package/package.json +3 -3
- package/build/android/Branch.d.ts +0 -5
- package/build/android/Branch.js +0 -54
- package/build/android/Branch.js.map +0 -1
- package/build/android/Facebook.d.ts +0 -13
- package/build/android/Facebook.js +0 -236
- package/build/android/Facebook.js.map +0 -1
- package/build/android/NavigationBar.d.ts +0 -9
- package/build/android/NavigationBar.js +0 -141
- package/build/android/NavigationBar.js.map +0 -1
- package/build/android/RootViewBackgroundColor.d.ts +0 -6
- package/build/android/RootViewBackgroundColor.js +0 -81
- package/build/android/RootViewBackgroundColor.js.map +0 -1
- package/build/android/UserInterfaceStyle.d.ts +0 -11
- package/build/android/UserInterfaceStyle.js +0 -125
- package/build/android/UserInterfaceStyle.js.map +0 -1
- package/build/ios/Branch.d.ts +0 -5
- package/build/ios/Branch.js +0 -42
- package/build/ios/Branch.js.map +0 -1
- package/build/ios/Facebook.d.ts +0 -176
- package/build/ios/Facebook.js +0 -232
- package/build/ios/Facebook.js.map +0 -1
- package/build/ios/RootViewBackgroundColor.d.ts +0 -6
- package/build/ios/RootViewBackgroundColor.js +0 -70
- package/build/ios/RootViewBackgroundColor.js.map +0 -1
- package/build/ios/UserInterfaceStyle.d.ts +0 -5
- package/build/ios/UserInterfaceStyle.js +0 -59
- package/build/ios/UserInterfaceStyle.js.map +0 -1
package/build/android/Branch.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getBranchApiKey = getBranchApiKey;
|
|
7
|
-
exports.setBranchApiKey = setBranchApiKey;
|
|
8
|
-
exports.withBranch = void 0;
|
|
9
|
-
|
|
10
|
-
function _androidPlugins() {
|
|
11
|
-
const data = require("../plugins/android-plugins");
|
|
12
|
-
|
|
13
|
-
_androidPlugins = function () {
|
|
14
|
-
return data;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
return data;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function _Manifest() {
|
|
21
|
-
const data = require("./Manifest");
|
|
22
|
-
|
|
23
|
-
_Manifest = function () {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const META_BRANCH_KEY = 'io.branch.sdk.BranchKey';
|
|
31
|
-
const withBranch = (0, _androidPlugins().createAndroidManifestPlugin)(setBranchApiKey, 'withBranch');
|
|
32
|
-
exports.withBranch = withBranch;
|
|
33
|
-
|
|
34
|
-
function getBranchApiKey(config) {
|
|
35
|
-
var _config$android$confi, _config$android, _config$android$confi2, _config$android$confi3;
|
|
36
|
-
|
|
37
|
-
return (_config$android$confi = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : (_config$android$confi2 = _config$android.config) === null || _config$android$confi2 === void 0 ? void 0 : (_config$android$confi3 = _config$android$confi2.branch) === null || _config$android$confi3 === void 0 ? void 0 : _config$android$confi3.apiKey) !== null && _config$android$confi !== void 0 ? _config$android$confi : null;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function setBranchApiKey(config, androidManifest) {
|
|
41
|
-
const apiKey = getBranchApiKey(config);
|
|
42
|
-
const mainApplication = (0, _Manifest().getMainApplicationOrThrow)(androidManifest);
|
|
43
|
-
|
|
44
|
-
if (apiKey) {
|
|
45
|
-
// If the item exists, add it back
|
|
46
|
-
(0, _Manifest().addMetaDataItemToMainApplication)(mainApplication, META_BRANCH_KEY, apiKey);
|
|
47
|
-
} else {
|
|
48
|
-
// Remove any existing item
|
|
49
|
-
(0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, META_BRANCH_KEY);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return androidManifest;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=Branch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/android/Branch.ts"],"names":["META_BRANCH_KEY","withBranch","setBranchApiKey","getBranchApiKey","config","android","branch","apiKey","androidManifest","mainApplication"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAOA,MAAMA,eAAe,GAAG,yBAAxB;AAEO,MAAMC,UAAU,GAAG,mDAA4BC,eAA5B,EAA6C,YAA7C,CAAnB;;;AAEA,SAASC,eAAT,CAAyBC,MAAzB,EAA6C;AAAA;;AAClD,qDAAOA,MAAM,CAACC,OAAd,8EAAO,gBAAgBD,MAAvB,qFAAO,uBAAwBE,MAA/B,2DAAO,uBAAgCC,MAAvC,yEAAiD,IAAjD;AACD;;AAEM,SAASL,eAAT,CAAyBE,MAAzB,EAA6CI,eAA7C,EAA+E;AACpF,QAAMD,MAAM,GAAGJ,eAAe,CAACC,MAAD,CAA9B;AAEA,QAAMK,eAAe,GAAG,2CAA0BD,eAA1B,CAAxB;;AAEA,MAAID,MAAJ,EAAY;AACV;AACA,sDAAiCE,eAAjC,EAAkDT,eAAlD,EAAmEO,MAAnE;AACD,GAHD,MAGO;AACL;AACA,2DAAsCE,eAAtC,EAAuDT,eAAvD;AACD;;AACD,SAAOQ,eAAP;AACD","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\nimport {\n addMetaDataItemToMainApplication,\n AndroidManifest,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} from './Manifest';\n\nconst META_BRANCH_KEY = 'io.branch.sdk.BranchKey';\n\nexport const withBranch = createAndroidManifestPlugin(setBranchApiKey, 'withBranch');\n\nexport function getBranchApiKey(config: ExpoConfig) {\n return config.android?.config?.branch?.apiKey ?? null;\n}\n\nexport function setBranchApiKey(config: ExpoConfig, androidManifest: AndroidManifest) {\n const apiKey = getBranchApiKey(config);\n\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (apiKey) {\n // If the item exists, add it back\n addMetaDataItemToMainApplication(mainApplication, META_BRANCH_KEY, apiKey);\n } else {\n // Remove any existing item\n removeMetaDataItemFromMainApplication(mainApplication, META_BRANCH_KEY);\n }\n return androidManifest;\n}\n"],"file":"Branch.js"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import { AndroidManifest } from './Manifest';
|
|
3
|
-
export declare const withFacebookAppIdString: import("..").ConfigPlugin<void>;
|
|
4
|
-
export declare const withFacebookManifest: import("..").ConfigPlugin<void>;
|
|
5
|
-
declare type ExpoConfigFacebook = Pick<ExpoConfig, 'facebookScheme' | 'facebookAdvertiserIDCollectionEnabled' | 'facebookAppId' | 'facebookAutoInitEnabled' | 'facebookAutoLogAppEventsEnabled' | 'facebookDisplayName'>;
|
|
6
|
-
export declare function getFacebookScheme(config: ExpoConfigFacebook): string | null;
|
|
7
|
-
export declare function getFacebookAppId(config: ExpoConfigFacebook): string | null;
|
|
8
|
-
export declare function getFacebookDisplayName(config: ExpoConfigFacebook): string | null;
|
|
9
|
-
export declare function getFacebookAutoInitEnabled(config: ExpoConfigFacebook): boolean | null;
|
|
10
|
-
export declare function getFacebookAutoLogAppEvents(config: ExpoConfigFacebook): boolean | null;
|
|
11
|
-
export declare function getFacebookAdvertiserIDCollection(config: ExpoConfigFacebook): boolean | null;
|
|
12
|
-
export declare function setFacebookConfig(config: ExpoConfigFacebook, androidManifest: AndroidManifest): AndroidManifest;
|
|
13
|
-
export {};
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getFacebookScheme = getFacebookScheme;
|
|
7
|
-
exports.getFacebookAppId = getFacebookAppId;
|
|
8
|
-
exports.getFacebookDisplayName = getFacebookDisplayName;
|
|
9
|
-
exports.getFacebookAutoInitEnabled = getFacebookAutoInitEnabled;
|
|
10
|
-
exports.getFacebookAutoLogAppEvents = getFacebookAutoLogAppEvents;
|
|
11
|
-
exports.getFacebookAdvertiserIDCollection = getFacebookAdvertiserIDCollection;
|
|
12
|
-
exports.setFacebookConfig = setFacebookConfig;
|
|
13
|
-
exports.withFacebookManifest = exports.withFacebookAppIdString = void 0;
|
|
14
|
-
|
|
15
|
-
function _androidPlugins() {
|
|
16
|
-
const data = require("../plugins/android-plugins");
|
|
17
|
-
|
|
18
|
-
_androidPlugins = function () {
|
|
19
|
-
return data;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
return data;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function _Manifest() {
|
|
26
|
-
const data = require("./Manifest");
|
|
27
|
-
|
|
28
|
-
_Manifest = function () {
|
|
29
|
-
return data;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
return data;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function _Resources() {
|
|
36
|
-
const data = require("./Resources");
|
|
37
|
-
|
|
38
|
-
_Resources = function () {
|
|
39
|
-
return data;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
return data;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function _Strings() {
|
|
46
|
-
const data = require("./Strings");
|
|
47
|
-
|
|
48
|
-
_Strings = function () {
|
|
49
|
-
return data;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
return data;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const CUSTOM_TAB_ACTIVITY = 'com.facebook.CustomTabActivity';
|
|
56
|
-
const STRING_FACEBOOK_APP_ID = 'facebook_app_id';
|
|
57
|
-
const META_APP_ID = 'com.facebook.sdk.ApplicationId';
|
|
58
|
-
const META_APP_NAME = 'com.facebook.sdk.ApplicationName';
|
|
59
|
-
const META_AUTO_INIT = 'com.facebook.sdk.AutoInitEnabled';
|
|
60
|
-
const META_AUTO_LOG_APP_EVENTS = 'com.facebook.sdk.AutoLogAppEventsEnabled';
|
|
61
|
-
const META_AD_ID_COLLECTION = 'com.facebook.sdk.AdvertiserIDCollectionEnabled';
|
|
62
|
-
const withFacebookAppIdString = (0, _androidPlugins().createStringsXmlPlugin)(applyFacebookAppIdString, 'withFacebookAppIdString');
|
|
63
|
-
exports.withFacebookAppIdString = withFacebookAppIdString;
|
|
64
|
-
const withFacebookManifest = (0, _androidPlugins().createAndroidManifestPlugin)(setFacebookConfig, 'withFacebookManifest');
|
|
65
|
-
exports.withFacebookManifest = withFacebookManifest;
|
|
66
|
-
|
|
67
|
-
function buildXMLItem({
|
|
68
|
-
head,
|
|
69
|
-
children
|
|
70
|
-
}) {
|
|
71
|
-
return { ...(children !== null && children !== void 0 ? children : {}),
|
|
72
|
-
$: head
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function buildAndroidItem(datum) {
|
|
77
|
-
const item = typeof datum === 'string' ? {
|
|
78
|
-
name: datum
|
|
79
|
-
} : datum;
|
|
80
|
-
const head = (0, _Manifest().prefixAndroidKeys)(item);
|
|
81
|
-
return buildXMLItem({
|
|
82
|
-
head
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function getFacebookSchemeActivity(scheme) {
|
|
87
|
-
/**
|
|
88
|
-
<activity
|
|
89
|
-
android:name="com.facebook.CustomTabActivity"
|
|
90
|
-
android:exported="true">
|
|
91
|
-
<intent-filter>
|
|
92
|
-
<action android:name="android.intent.action.VIEW" />
|
|
93
|
-
<category android:name="android.intent.category.DEFAULT" />
|
|
94
|
-
<category android:name="android.intent.category.BROWSABLE" />
|
|
95
|
-
<data android:scheme="${scheme}" />
|
|
96
|
-
</intent-filter>
|
|
97
|
-
</activity>
|
|
98
|
-
*/
|
|
99
|
-
return buildXMLItem({
|
|
100
|
-
head: (0, _Manifest().prefixAndroidKeys)({
|
|
101
|
-
name: CUSTOM_TAB_ACTIVITY,
|
|
102
|
-
exported: 'true'
|
|
103
|
-
}),
|
|
104
|
-
children: {
|
|
105
|
-
'intent-filter': [{
|
|
106
|
-
action: [buildAndroidItem('android.intent.action.VIEW')],
|
|
107
|
-
category: [buildAndroidItem('android.intent.category.DEFAULT'), buildAndroidItem('android.intent.category.BROWSABLE')],
|
|
108
|
-
data: [buildAndroidItem({
|
|
109
|
-
scheme
|
|
110
|
-
})]
|
|
111
|
-
}]
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function getFacebookScheme(config) {
|
|
117
|
-
var _config$facebookSchem;
|
|
118
|
-
|
|
119
|
-
return (_config$facebookSchem = config.facebookScheme) !== null && _config$facebookSchem !== void 0 ? _config$facebookSchem : null;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function getFacebookAppId(config) {
|
|
123
|
-
var _config$facebookAppId;
|
|
124
|
-
|
|
125
|
-
return (_config$facebookAppId = config.facebookAppId) !== null && _config$facebookAppId !== void 0 ? _config$facebookAppId : null;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function getFacebookDisplayName(config) {
|
|
129
|
-
var _config$facebookDispl;
|
|
130
|
-
|
|
131
|
-
return (_config$facebookDispl = config.facebookDisplayName) !== null && _config$facebookDispl !== void 0 ? _config$facebookDispl : null;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function getFacebookAutoInitEnabled(config) {
|
|
135
|
-
var _config$facebookAutoI;
|
|
136
|
-
|
|
137
|
-
return (_config$facebookAutoI = config.facebookAutoInitEnabled) !== null && _config$facebookAutoI !== void 0 ? _config$facebookAutoI : null;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function getFacebookAutoLogAppEvents(config) {
|
|
141
|
-
var _config$facebookAutoL;
|
|
142
|
-
|
|
143
|
-
return (_config$facebookAutoL = config.facebookAutoLogAppEventsEnabled) !== null && _config$facebookAutoL !== void 0 ? _config$facebookAutoL : null;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function getFacebookAdvertiserIDCollection(config) {
|
|
147
|
-
var _config$facebookAdver;
|
|
148
|
-
|
|
149
|
-
return (_config$facebookAdver = config.facebookAdvertiserIDCollectionEnabled) !== null && _config$facebookAdver !== void 0 ? _config$facebookAdver : null;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function ensureFacebookActivity({
|
|
153
|
-
mainApplication,
|
|
154
|
-
scheme
|
|
155
|
-
}) {
|
|
156
|
-
if (Array.isArray(mainApplication.activity)) {
|
|
157
|
-
// Remove all Facebook CustomTabActivities first
|
|
158
|
-
mainApplication.activity = mainApplication.activity.filter(activity => {
|
|
159
|
-
var _activity$$;
|
|
160
|
-
|
|
161
|
-
return ((_activity$$ = activity.$) === null || _activity$$ === void 0 ? void 0 : _activity$$['android:name']) !== CUSTOM_TAB_ACTIVITY;
|
|
162
|
-
});
|
|
163
|
-
} else {
|
|
164
|
-
mainApplication.activity = [];
|
|
165
|
-
} // If a new scheme is defined, append it to the activity.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (scheme) {
|
|
169
|
-
mainApplication.activity.push(getFacebookSchemeActivity(scheme));
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return mainApplication;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function applyFacebookAppIdString(config, stringsJSON) {
|
|
176
|
-
const appId = getFacebookAppId(config);
|
|
177
|
-
|
|
178
|
-
if (appId) {
|
|
179
|
-
return (0, _Strings().setStringItem)([(0, _Resources().buildResourceItem)({
|
|
180
|
-
name: STRING_FACEBOOK_APP_ID,
|
|
181
|
-
value: appId
|
|
182
|
-
})], stringsJSON);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return (0, _Strings().removeStringItem)(STRING_FACEBOOK_APP_ID, stringsJSON);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function setFacebookConfig(config, androidManifest) {
|
|
189
|
-
const scheme = getFacebookScheme(config);
|
|
190
|
-
const appId = getFacebookAppId(config);
|
|
191
|
-
const displayName = getFacebookDisplayName(config);
|
|
192
|
-
const autoInitEnabled = getFacebookAutoInitEnabled(config);
|
|
193
|
-
const autoLogAppEvents = getFacebookAutoLogAppEvents(config);
|
|
194
|
-
const advertiserIdCollection = getFacebookAdvertiserIDCollection(config);
|
|
195
|
-
let mainApplication = (0, _Manifest().getMainApplicationOrThrow)(androidManifest);
|
|
196
|
-
mainApplication = ensureFacebookActivity({
|
|
197
|
-
scheme,
|
|
198
|
-
mainApplication
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
if (appId) {
|
|
202
|
-
mainApplication = (0, _Manifest().addMetaDataItemToMainApplication)(mainApplication, META_APP_ID, // The corresponding string is set in applyFacebookAppIdString
|
|
203
|
-
`@string/${STRING_FACEBOOK_APP_ID}`);
|
|
204
|
-
} else {
|
|
205
|
-
mainApplication = (0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, META_APP_ID);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (displayName) {
|
|
209
|
-
mainApplication = (0, _Manifest().addMetaDataItemToMainApplication)(mainApplication, META_APP_NAME, displayName);
|
|
210
|
-
} else {
|
|
211
|
-
mainApplication = (0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, META_APP_NAME);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
if (autoInitEnabled !== null) {
|
|
215
|
-
mainApplication = (0, _Manifest().addMetaDataItemToMainApplication)(mainApplication, META_AUTO_INIT, autoInitEnabled ? 'true' : 'false');
|
|
216
|
-
} else {
|
|
217
|
-
mainApplication = (0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, META_AUTO_INIT);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
if (autoLogAppEvents !== null) {
|
|
221
|
-
mainApplication = (0, _Manifest().addMetaDataItemToMainApplication)(mainApplication, META_AUTO_LOG_APP_EVENTS, autoLogAppEvents ? 'true' : 'false');
|
|
222
|
-
} else {
|
|
223
|
-
mainApplication = (0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, META_AUTO_LOG_APP_EVENTS);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
if (advertiserIdCollection !== null) {
|
|
227
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
228
|
-
mainApplication = (0, _Manifest().addMetaDataItemToMainApplication)(mainApplication, META_AD_ID_COLLECTION, advertiserIdCollection ? 'true' : 'false');
|
|
229
|
-
} else {
|
|
230
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
231
|
-
mainApplication = (0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, META_AD_ID_COLLECTION);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return androidManifest;
|
|
235
|
-
}
|
|
236
|
-
//# sourceMappingURL=Facebook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/android/Facebook.ts"],"names":["CUSTOM_TAB_ACTIVITY","STRING_FACEBOOK_APP_ID","META_APP_ID","META_APP_NAME","META_AUTO_INIT","META_AUTO_LOG_APP_EVENTS","META_AD_ID_COLLECTION","withFacebookAppIdString","applyFacebookAppIdString","withFacebookManifest","setFacebookConfig","buildXMLItem","head","children","$","buildAndroidItem","datum","item","name","getFacebookSchemeActivity","scheme","exported","action","category","data","getFacebookScheme","config","facebookScheme","getFacebookAppId","facebookAppId","getFacebookDisplayName","facebookDisplayName","getFacebookAutoInitEnabled","facebookAutoInitEnabled","getFacebookAutoLogAppEvents","facebookAutoLogAppEventsEnabled","getFacebookAdvertiserIDCollection","facebookAdvertiserIDCollectionEnabled","ensureFacebookActivity","mainApplication","Array","isArray","activity","filter","push","stringsJSON","appId","value","androidManifest","displayName","autoInitEnabled","autoLogAppEvents","advertiserIdCollection"],"mappings":";;;;;;;;;;;;;;AAEA;AAAA;;AAAA;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createStringsXmlPlugin } from '../plugins/android-plugins';\nimport {\n addMetaDataItemToMainApplication,\n AndroidManifest,\n getMainApplicationOrThrow,\n ManifestActivity,\n ManifestApplication,\n prefixAndroidKeys,\n removeMetaDataItemFromMainApplication,\n} from './Manifest';\nimport { buildResourceItem, ResourceXML } from './Resources';\nimport { removeStringItem, setStringItem } from './Strings';\n\nconst CUSTOM_TAB_ACTIVITY = 'com.facebook.CustomTabActivity';\nconst STRING_FACEBOOK_APP_ID = 'facebook_app_id';\nconst META_APP_ID = 'com.facebook.sdk.ApplicationId';\nconst META_APP_NAME = 'com.facebook.sdk.ApplicationName';\nconst META_AUTO_INIT = 'com.facebook.sdk.AutoInitEnabled';\nconst META_AUTO_LOG_APP_EVENTS = 'com.facebook.sdk.AutoLogAppEventsEnabled';\nconst META_AD_ID_COLLECTION = 'com.facebook.sdk.AdvertiserIDCollectionEnabled';\n\nexport const withFacebookAppIdString = createStringsXmlPlugin(\n applyFacebookAppIdString,\n 'withFacebookAppIdString'\n);\nexport const withFacebookManifest = createAndroidManifestPlugin(\n setFacebookConfig,\n 'withFacebookManifest'\n);\n\nfunction buildXMLItem({\n head,\n children,\n}: {\n head: Record<string, string>;\n children?: Record<string, string | any[]>;\n}) {\n return { ...(children ?? {}), $: head };\n}\n\nfunction buildAndroidItem(datum: string | Record<string, any>) {\n const item = typeof datum === 'string' ? { name: datum } : datum;\n const head = prefixAndroidKeys(item);\n return buildXMLItem({ head });\n}\n\nfunction getFacebookSchemeActivity(scheme: string) {\n /**\n <activity\n android:name=\"com.facebook.CustomTabActivity\"\n android:exported=\"true\">\n <intent-filter>\n <action android:name=\"android.intent.action.VIEW\" />\n <category android:name=\"android.intent.category.DEFAULT\" />\n <category android:name=\"android.intent.category.BROWSABLE\" />\n <data android:scheme=\"${scheme}\" />\n </intent-filter>\n</activity>\n */\n return buildXMLItem({\n head: prefixAndroidKeys({\n name: CUSTOM_TAB_ACTIVITY,\n exported: 'true',\n }),\n children: {\n 'intent-filter': [\n {\n action: [buildAndroidItem('android.intent.action.VIEW')],\n category: [\n buildAndroidItem('android.intent.category.DEFAULT'),\n buildAndroidItem('android.intent.category.BROWSABLE'),\n ],\n data: [buildAndroidItem({ scheme })],\n },\n ],\n },\n }) as ManifestActivity;\n}\n\ntype ExpoConfigFacebook = Pick<\n ExpoConfig,\n | 'facebookScheme'\n | 'facebookAdvertiserIDCollectionEnabled'\n | 'facebookAppId'\n | 'facebookAutoInitEnabled'\n | 'facebookAutoLogAppEventsEnabled'\n | 'facebookDisplayName'\n>;\n\nexport function getFacebookScheme(config: ExpoConfigFacebook) {\n return config.facebookScheme ?? null;\n}\n\nexport function getFacebookAppId(config: ExpoConfigFacebook) {\n return config.facebookAppId ?? null;\n}\n\nexport function getFacebookDisplayName(config: ExpoConfigFacebook) {\n return config.facebookDisplayName ?? null;\n}\nexport function getFacebookAutoInitEnabled(config: ExpoConfigFacebook) {\n return config.facebookAutoInitEnabled ?? null;\n}\n\nexport function getFacebookAutoLogAppEvents(config: ExpoConfigFacebook) {\n return config.facebookAutoLogAppEventsEnabled ?? null;\n}\n\nexport function getFacebookAdvertiserIDCollection(config: ExpoConfigFacebook) {\n return config.facebookAdvertiserIDCollectionEnabled ?? null;\n}\n\nfunction ensureFacebookActivity({\n mainApplication,\n scheme,\n}: {\n mainApplication: ManifestApplication;\n scheme: string | null;\n}) {\n if (Array.isArray(mainApplication.activity)) {\n // Remove all Facebook CustomTabActivities first\n mainApplication.activity = mainApplication.activity.filter(activity => {\n return activity.$?.['android:name'] !== CUSTOM_TAB_ACTIVITY;\n });\n } else {\n mainApplication.activity = [];\n }\n\n // If a new scheme is defined, append it to the activity.\n if (scheme) {\n mainApplication.activity.push(getFacebookSchemeActivity(scheme));\n }\n return mainApplication;\n}\n\nfunction applyFacebookAppIdString(config: ExpoConfigFacebook, stringsJSON: ResourceXML) {\n const appId = getFacebookAppId(config);\n\n if (appId) {\n return setStringItem(\n [buildResourceItem({ name: STRING_FACEBOOK_APP_ID, value: appId })],\n stringsJSON\n );\n }\n return removeStringItem(STRING_FACEBOOK_APP_ID, stringsJSON);\n}\n\nexport function setFacebookConfig(config: ExpoConfigFacebook, androidManifest: AndroidManifest) {\n const scheme = getFacebookScheme(config);\n\n const appId = getFacebookAppId(config);\n const displayName = getFacebookDisplayName(config);\n const autoInitEnabled = getFacebookAutoInitEnabled(config);\n const autoLogAppEvents = getFacebookAutoLogAppEvents(config);\n const advertiserIdCollection = getFacebookAdvertiserIDCollection(config);\n\n let mainApplication = getMainApplicationOrThrow(androidManifest);\n\n mainApplication = ensureFacebookActivity({ scheme, mainApplication });\n\n if (appId) {\n mainApplication = addMetaDataItemToMainApplication(\n mainApplication,\n META_APP_ID,\n // The corresponding string is set in applyFacebookAppIdString\n `@string/${STRING_FACEBOOK_APP_ID}`\n );\n } else {\n mainApplication = removeMetaDataItemFromMainApplication(mainApplication, META_APP_ID);\n }\n if (displayName) {\n mainApplication = addMetaDataItemToMainApplication(mainApplication, META_APP_NAME, displayName);\n } else {\n mainApplication = removeMetaDataItemFromMainApplication(mainApplication, META_APP_NAME);\n }\n if (autoInitEnabled !== null) {\n mainApplication = addMetaDataItemToMainApplication(\n mainApplication,\n META_AUTO_INIT,\n autoInitEnabled ? 'true' : 'false'\n );\n } else {\n mainApplication = removeMetaDataItemFromMainApplication(mainApplication, META_AUTO_INIT);\n }\n if (autoLogAppEvents !== null) {\n mainApplication = addMetaDataItemToMainApplication(\n mainApplication,\n META_AUTO_LOG_APP_EVENTS,\n autoLogAppEvents ? 'true' : 'false'\n );\n } else {\n mainApplication = removeMetaDataItemFromMainApplication(\n mainApplication,\n META_AUTO_LOG_APP_EVENTS\n );\n }\n if (advertiserIdCollection !== null) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n mainApplication = addMetaDataItemToMainApplication(\n mainApplication,\n META_AD_ID_COLLECTION,\n advertiserIdCollection ? 'true' : 'false'\n );\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n mainApplication = removeMetaDataItemFromMainApplication(mainApplication, META_AD_ID_COLLECTION);\n }\n\n return androidManifest;\n}\n"],"file":"Facebook.js"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import { ConfigPlugin } from '../Plugin.types';
|
|
3
|
-
import { ResourceXML } from './Resources';
|
|
4
|
-
export declare const withNavigationBar: ConfigPlugin;
|
|
5
|
-
export declare function setNavigationBarColors(config: Pick<ExpoConfig, 'androidNavigationBar'>, colors: ResourceXML): ResourceXML;
|
|
6
|
-
export declare function setNavigationBarStyles(config: Pick<ExpoConfig, 'androidNavigationBar'>, styles: ResourceXML): ResourceXML;
|
|
7
|
-
export declare function getNavigationBarImmersiveMode(config: Pick<ExpoConfig, 'androidNavigationBar'>): "leanback" | "immersive" | "sticky-immersive" | null;
|
|
8
|
-
export declare function getNavigationBarColor(config: Pick<ExpoConfig, 'androidNavigationBar'>): string | null;
|
|
9
|
-
export declare function getNavigationBarStyle(config: Pick<ExpoConfig, 'androidNavigationBar'>): "light-content" | "dark-content";
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.setNavigationBarColors = setNavigationBarColors;
|
|
7
|
-
exports.setNavigationBarStyles = setNavigationBarStyles;
|
|
8
|
-
exports.getNavigationBarImmersiveMode = getNavigationBarImmersiveMode;
|
|
9
|
-
exports.getNavigationBarColor = getNavigationBarColor;
|
|
10
|
-
exports.getNavigationBarStyle = getNavigationBarStyle;
|
|
11
|
-
exports.withNavigationBar = void 0;
|
|
12
|
-
|
|
13
|
-
function _androidPlugins() {
|
|
14
|
-
const data = require("../plugins/android-plugins");
|
|
15
|
-
|
|
16
|
-
_androidPlugins = function () {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function _warnings() {
|
|
24
|
-
const data = require("../utils/warnings");
|
|
25
|
-
|
|
26
|
-
_warnings = function () {
|
|
27
|
-
return data;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return data;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function _Colors() {
|
|
34
|
-
const data = require("./Colors");
|
|
35
|
-
|
|
36
|
-
_Colors = function () {
|
|
37
|
-
return data;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _Resources() {
|
|
44
|
-
const data = require("./Resources");
|
|
45
|
-
|
|
46
|
-
_Resources = function () {
|
|
47
|
-
return data;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return data;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function _Styles() {
|
|
54
|
-
const data = require("./Styles");
|
|
55
|
-
|
|
56
|
-
_Styles = function () {
|
|
57
|
-
return data;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return data;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const NAVIGATION_BAR_COLOR = 'navigationBarColor';
|
|
64
|
-
|
|
65
|
-
const withNavigationBar = config => {
|
|
66
|
-
const immersiveMode = getNavigationBarImmersiveMode(config);
|
|
67
|
-
|
|
68
|
-
if (immersiveMode) {
|
|
69
|
-
// Immersive mode needs to be set programmatically
|
|
70
|
-
// TODO: Resolve
|
|
71
|
-
(0, _warnings().addWarningAndroid)('androidNavigationBar.visible', 'Hiding the navigation bar must be done programmatically', 'https://developer.android.com/training/system-ui/immersive');
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
config = withNavigationBarColors(config);
|
|
75
|
-
config = withNavigationBarStyles(config);
|
|
76
|
-
return config;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
exports.withNavigationBar = withNavigationBar;
|
|
80
|
-
|
|
81
|
-
const withNavigationBarColors = config => {
|
|
82
|
-
return (0, _androidPlugins().withAndroidColors)(config, config => {
|
|
83
|
-
config.modResults = setNavigationBarColors(config, config.modResults);
|
|
84
|
-
return config;
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const withNavigationBarStyles = config => {
|
|
89
|
-
return (0, _androidPlugins().withAndroidStyles)(config, config => {
|
|
90
|
-
config.modResults = setNavigationBarStyles(config, config.modResults);
|
|
91
|
-
return config;
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
function setNavigationBarColors(config, colors) {
|
|
96
|
-
const hexString = getNavigationBarColor(config);
|
|
97
|
-
|
|
98
|
-
if (hexString) {
|
|
99
|
-
colors = (0, _Colors().setColorItem)((0, _Resources().buildResourceItem)({
|
|
100
|
-
name: NAVIGATION_BAR_COLOR,
|
|
101
|
-
value: hexString
|
|
102
|
-
}), colors);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return colors;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function setNavigationBarStyles(config, styles) {
|
|
109
|
-
styles = (0, _Styles().assignStylesValue)(styles, {
|
|
110
|
-
add: !!getNavigationBarColor(config),
|
|
111
|
-
parent: (0, _Styles().getAppThemeLightNoActionBarGroup)(),
|
|
112
|
-
name: `android:${NAVIGATION_BAR_COLOR}`,
|
|
113
|
-
value: `@color/${NAVIGATION_BAR_COLOR}`
|
|
114
|
-
});
|
|
115
|
-
styles = (0, _Styles().assignStylesValue)(styles, {
|
|
116
|
-
add: getNavigationBarStyle(config) === 'dark-content',
|
|
117
|
-
parent: (0, _Styles().getAppThemeLightNoActionBarGroup)(),
|
|
118
|
-
name: 'android:windowLightNavigationBar',
|
|
119
|
-
value: 'true'
|
|
120
|
-
});
|
|
121
|
-
return styles;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function getNavigationBarImmersiveMode(config) {
|
|
125
|
-
var _config$androidNaviga;
|
|
126
|
-
|
|
127
|
-
return ((_config$androidNaviga = config.androidNavigationBar) === null || _config$androidNaviga === void 0 ? void 0 : _config$androidNaviga.visible) || null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function getNavigationBarColor(config) {
|
|
131
|
-
var _config$androidNaviga2;
|
|
132
|
-
|
|
133
|
-
return ((_config$androidNaviga2 = config.androidNavigationBar) === null || _config$androidNaviga2 === void 0 ? void 0 : _config$androidNaviga2.backgroundColor) || null;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function getNavigationBarStyle(config) {
|
|
137
|
-
var _config$androidNaviga3;
|
|
138
|
-
|
|
139
|
-
return ((_config$androidNaviga3 = config.androidNavigationBar) === null || _config$androidNaviga3 === void 0 ? void 0 : _config$androidNaviga3.barStyle) || 'light-content';
|
|
140
|
-
}
|
|
141
|
-
//# sourceMappingURL=NavigationBar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/android/NavigationBar.ts"],"names":["NAVIGATION_BAR_COLOR","withNavigationBar","config","immersiveMode","getNavigationBarImmersiveMode","withNavigationBarColors","withNavigationBarStyles","modResults","setNavigationBarColors","setNavigationBarStyles","colors","hexString","getNavigationBarColor","name","value","styles","add","parent","getNavigationBarStyle","androidNavigationBar","visible","backgroundColor","barStyle"],"mappings":";;;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA,MAAMA,oBAAoB,GAAG,oBAA7B;;AAEO,MAAMC,iBAA+B,GAAGC,MAAM,IAAI;AACvD,QAAMC,aAAa,GAAGC,6BAA6B,CAACF,MAAD,CAAnD;;AACA,MAAIC,aAAJ,EAAmB;AACjB;AACA;AACA,uCACE,8BADF,EAEE,yDAFF,EAGE,4DAHF;AAKD;;AAEDD,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AG,iCAAkBA,MAAlB,EAA0B;AACjCC,IAAAA,GAAG,EAAEE,qBAAqB,CAAChB,MAAD,CAArB,KAAkC,cADN;AAEjCe,IAAAA,MAAM,EAAE,iDAFyB;AAGjCJ,IAAAA,IAAI,EAAE,kCAH2B;AAIjCC,IAAAA,KAAK,EAAE;AAJ0B,GAA1B,CAAT;AAOA,SAAOC,MAAP;AACD;;AAEM,SAASX,6BAAT,CAAuCF,MAAvC,EAAyF;AAAA;;AAC9F,SAAO,0BAAAA,MAAM,CAACiB,oBAAP,gFAA6BC,OAA7B,KAAwC,IAA/C;AACD;;AAEM,SAASR,qBAAT,CAA+BV,MAA/B,EAAiF;AAAA;;AACtF,SAAO,2BAAAA,MAAM,CAACiB,oBAAP,kFAA6BE,eAA7B,KAAgD,IAAvD;AACD;;AAEM,SAASH,qBAAT,CAA+BhB,MAA/B,EAAiF;AAAA;;AACtF,SAAO,2BAAAA,MAAM,CAACiB,oBAAP,kFAA6BG,QAA7B,KAAyC,eAAhD;AACD","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withAndroidColors, withAndroidStyles } from '../plugins/android-plugins';\nimport { addWarningAndroid } from '../utils/warnings';\nimport { setColorItem } from './Colors';\nimport { buildResourceItem, ResourceXML } from './Resources';\nimport { assignStylesValue, getAppThemeLightNoActionBarGroup } from './Styles';\n\nconst NAVIGATION_BAR_COLOR = 'navigationBarColor';\n\nexport const withNavigationBar: ConfigPlugin = config => {\n const immersiveMode = getNavigationBarImmersiveMode(config);\n if (immersiveMode) {\n // Immersive mode needs to be set programmatically\n // TODO: Resolve\n addWarningAndroid(\n 'androidNavigationBar.visible',\n 'Hiding the navigation bar must be done programmatically',\n 'https://developer.android.com/training/system-ui/immersive'\n );\n }\n\n config = withNavigationBarColors(config);\n config = withNavigationBarStyles(config);\n return config;\n};\n\nconst withNavigationBarColors: ConfigPlugin = config => {\n return withAndroidColors(config, config => {\n config.modResults = setNavigationBarColors(config, config.modResults);\n return config;\n });\n};\n\nconst withNavigationBarStyles: ConfigPlugin = config => {\n return withAndroidStyles(config, config => {\n config.modResults = setNavigationBarStyles(config, config.modResults);\n return config;\n });\n};\n\nexport function setNavigationBarColors(\n config: Pick<ExpoConfig, 'androidNavigationBar'>,\n colors: ResourceXML\n): ResourceXML {\n const hexString = getNavigationBarColor(config);\n if (hexString) {\n colors = setColorItem(\n buildResourceItem({\n name: NAVIGATION_BAR_COLOR,\n value: hexString,\n }),\n colors\n );\n }\n return colors;\n}\n\nexport function setNavigationBarStyles(\n config: Pick<ExpoConfig, 'androidNavigationBar'>,\n styles: ResourceXML\n): ResourceXML {\n styles = assignStylesValue(styles, {\n add: !!getNavigationBarColor(config),\n parent: getAppThemeLightNoActionBarGroup(),\n name: `android:${NAVIGATION_BAR_COLOR}`,\n value: `@color/${NAVIGATION_BAR_COLOR}`,\n });\n\n styles = assignStylesValue(styles, {\n add: getNavigationBarStyle(config) === 'dark-content',\n parent: getAppThemeLightNoActionBarGroup(),\n name: 'android:windowLightNavigationBar',\n value: 'true',\n });\n\n return styles;\n}\n\nexport function getNavigationBarImmersiveMode(config: Pick<ExpoConfig, 'androidNavigationBar'>) {\n return config.androidNavigationBar?.visible || null;\n}\n\nexport function getNavigationBarColor(config: Pick<ExpoConfig, 'androidNavigationBar'>) {\n return config.androidNavigationBar?.backgroundColor || null;\n}\n\nexport function getNavigationBarStyle(config: Pick<ExpoConfig, 'androidNavigationBar'>) {\n return config.androidNavigationBar?.barStyle || 'light-content';\n}\n"],"file":"NavigationBar.js"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import { ConfigPlugin } from '../Plugin.types';
|
|
3
|
-
export declare const withRootViewBackgroundColor: ConfigPlugin;
|
|
4
|
-
export declare const withRootViewBackgroundColorColors: ConfigPlugin;
|
|
5
|
-
export declare const withRootViewBackgroundColorStyles: ConfigPlugin;
|
|
6
|
-
export declare function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'android' | 'backgroundColor'>): string | null;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
|
|
7
|
-
exports.withRootViewBackgroundColorStyles = exports.withRootViewBackgroundColorColors = exports.withRootViewBackgroundColor = void 0;
|
|
8
|
-
|
|
9
|
-
function _androidPlugins() {
|
|
10
|
-
const data = require("../plugins/android-plugins");
|
|
11
|
-
|
|
12
|
-
_androidPlugins = function () {
|
|
13
|
-
return data;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
return data;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function _Colors() {
|
|
20
|
-
const data = require("./Colors");
|
|
21
|
-
|
|
22
|
-
_Colors = function () {
|
|
23
|
-
return data;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function _Styles() {
|
|
30
|
-
const data = require("./Styles");
|
|
31
|
-
|
|
32
|
-
_Styles = function () {
|
|
33
|
-
return data;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
return data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const ANDROID_WINDOW_BACKGROUND = 'android:windowBackground';
|
|
40
|
-
const WINDOW_BACKGROUND_COLOR = 'activityBackground';
|
|
41
|
-
|
|
42
|
-
const withRootViewBackgroundColor = config => {
|
|
43
|
-
config = withRootViewBackgroundColorColors(config);
|
|
44
|
-
config = withRootViewBackgroundColorStyles(config);
|
|
45
|
-
return config;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.withRootViewBackgroundColor = withRootViewBackgroundColor;
|
|
49
|
-
|
|
50
|
-
const withRootViewBackgroundColorColors = config => {
|
|
51
|
-
return (0, _androidPlugins().withAndroidColors)(config, async config => {
|
|
52
|
-
config.modResults = (0, _Colors().assignColorValue)(config.modResults, {
|
|
53
|
-
value: getRootViewBackgroundColor(config),
|
|
54
|
-
name: WINDOW_BACKGROUND_COLOR
|
|
55
|
-
});
|
|
56
|
-
return config;
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
exports.withRootViewBackgroundColorColors = withRootViewBackgroundColorColors;
|
|
61
|
-
|
|
62
|
-
const withRootViewBackgroundColorStyles = config => {
|
|
63
|
-
return (0, _androidPlugins().withAndroidStyles)(config, async config => {
|
|
64
|
-
config.modResults = (0, _Styles().assignStylesValue)(config.modResults, {
|
|
65
|
-
add: !!getRootViewBackgroundColor(config),
|
|
66
|
-
parent: (0, _Styles().getAppThemeLightNoActionBarGroup)(),
|
|
67
|
-
name: ANDROID_WINDOW_BACKGROUND,
|
|
68
|
-
value: `@color/${WINDOW_BACKGROUND_COLOR}`
|
|
69
|
-
});
|
|
70
|
-
return config;
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
exports.withRootViewBackgroundColorStyles = withRootViewBackgroundColorStyles;
|
|
75
|
-
|
|
76
|
-
function getRootViewBackgroundColor(config) {
|
|
77
|
-
var _config$android;
|
|
78
|
-
|
|
79
|
-
return ((_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.backgroundColor) || config.backgroundColor || null;
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=RootViewBackgroundColor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/android/RootViewBackgroundColor.ts"],"names":["ANDROID_WINDOW_BACKGROUND","WINDOW_BACKGROUND_COLOR","withRootViewBackgroundColor","config","withRootViewBackgroundColorColors","withRootViewBackgroundColorStyles","modResults","value","getRootViewBackgroundColor","name","add","parent","android","backgroundColor"],"mappings":";;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAA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o/config-types';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withAndroidColors, withAndroidStyles } from '../plugins/android-plugins';\nimport { assignColorValue } from './Colors';\nimport { assignStylesValue, getAppThemeLightNoActionBarGroup } from './Styles';\n\nconst ANDROID_WINDOW_BACKGROUND = 'android:windowBackground';\nconst WINDOW_BACKGROUND_COLOR = 'activityBackground';\n\nexport const withRootViewBackgroundColor: 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"],"file":"RootViewBackgroundColor.js"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import { ConfigPlugin } from '../Plugin.types';
|
|
3
|
-
import { AndroidManifest } from './Manifest';
|
|
4
|
-
export declare const CONFIG_CHANGES_ATTRIBUTE = "android:configChanges";
|
|
5
|
-
export declare const ON_CONFIGURATION_CHANGED = "\npublic class MainActivity extends ReactActivity {\n\n // Added automatically by Expo Config\n @Override\n public void onConfigurationChanged(Configuration newConfig) {\n super.onConfigurationChanged(newConfig);\n Intent intent = new Intent(\"onConfigurationChanged\");\n intent.putExtra(\"newConfig\", newConfig);\n sendBroadcast(intent);\n }\n";
|
|
6
|
-
export declare const withUiModeManifest: ConfigPlugin<void>;
|
|
7
|
-
export declare const withUiModeMainActivity: ConfigPlugin;
|
|
8
|
-
export declare function getUserInterfaceStyle(config: Pick<ExpoConfig, 'android' | 'userInterfaceStyle'>): string;
|
|
9
|
-
export declare function setUiModeAndroidManifest(config: Pick<ExpoConfig, 'android' | 'userInterfaceStyle'>, androidManifest: AndroidManifest): AndroidManifest;
|
|
10
|
-
export declare function addOnConfigurationChangedMainActivity(config: Pick<ExpoConfig, 'android' | 'userInterfaceStyle'>, mainActivity: string): string;
|
|
11
|
-
export declare function addJavaImports(javaSource: string, javaImports: string[], isJava: boolean): string;
|