@expo/config-plugins 55.0.5 → 55.0.6
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.
|
@@ -2,15 +2,5 @@ import { ExpoConfig } from '@expo/config-types';
|
|
|
2
2
|
import { ResourceXML } from './Resources';
|
|
3
3
|
import { ConfigPlugin } from '../Plugin.types';
|
|
4
4
|
export declare const withStatusBar: ConfigPlugin;
|
|
5
|
-
export declare function setStatusBarColors(config: Pick<ExpoConfig, 'androidStatusBar'>, colors: ResourceXML): ResourceXML;
|
|
6
5
|
export declare function setStatusBarStyles(config: Pick<ExpoConfig, 'androidStatusBar'>, styles: ResourceXML): ResourceXML;
|
|
7
|
-
export declare function getStatusBarColor(config: Pick<ExpoConfig, 'androidStatusBar'>): string | undefined;
|
|
8
|
-
/**
|
|
9
|
-
* Specifies whether the status bar should be "translucent". When true, the status bar is drawn with `position: absolute` and a gray underlay, when false `position: relative` (pushes content down).
|
|
10
|
-
*
|
|
11
|
-
* @default false
|
|
12
|
-
* @param config
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export declare function getStatusBarTranslucent(config: Pick<ExpoConfig, 'androidStatusBar'>): boolean;
|
|
16
6
|
export declare function getStatusBarStyle(config: Pick<ExpoConfig, 'androidStatusBar'>): "light-content" | "dark-content";
|
|
@@ -3,26 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getStatusBarColor = getStatusBarColor;
|
|
7
6
|
exports.getStatusBarStyle = getStatusBarStyle;
|
|
8
|
-
exports.getStatusBarTranslucent = getStatusBarTranslucent;
|
|
9
|
-
exports.setStatusBarColors = setStatusBarColors;
|
|
10
7
|
exports.setStatusBarStyles = setStatusBarStyles;
|
|
11
8
|
exports.withStatusBar = void 0;
|
|
12
|
-
function _assert() {
|
|
13
|
-
const data = _interopRequireDefault(require("assert"));
|
|
14
|
-
_assert = function () {
|
|
15
|
-
return data;
|
|
16
|
-
};
|
|
17
|
-
return data;
|
|
18
|
-
}
|
|
19
|
-
function _Colors() {
|
|
20
|
-
const data = require("./Colors");
|
|
21
|
-
_Colors = function () {
|
|
22
|
-
return data;
|
|
23
|
-
};
|
|
24
|
-
return data;
|
|
25
|
-
}
|
|
26
9
|
function _Styles() {
|
|
27
10
|
const data = require("./Styles");
|
|
28
11
|
_Styles = function () {
|
|
@@ -37,40 +20,41 @@ function _androidPlugins() {
|
|
|
37
20
|
};
|
|
38
21
|
return data;
|
|
39
22
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
23
|
+
function WarningAggregator() {
|
|
24
|
+
const data = _interopRequireWildcard(require("../utils/warnings"));
|
|
25
|
+
WarningAggregator = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
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); }
|
|
31
|
+
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 && {}.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; }
|
|
32
|
+
const TAG = 'STATUS_BAR_PLUGIN';
|
|
43
33
|
// https://developer.android.com/reference/android/R.attr#windowLightStatusBar
|
|
44
34
|
const WINDOW_LIGHT_STATUS_BAR = 'android:windowLightStatusBar';
|
|
45
35
|
// https://developer.android.com/reference/android/R.attr#statusBarColor
|
|
46
36
|
const STATUS_BAR_COLOR = 'android:statusBarColor';
|
|
47
37
|
const withStatusBar = config => {
|
|
48
|
-
|
|
38
|
+
const {
|
|
39
|
+
androidStatusBar = {}
|
|
40
|
+
} = config;
|
|
41
|
+
if ('backgroundColor' in androidStatusBar) {
|
|
42
|
+
WarningAggregator().addWarningAndroid(TAG, 'Due to Android edge-to-edge enforcement, `androidStatusBar.backgroundColor` is deprecated and has no effect. This will be removed in a future release.');
|
|
43
|
+
}
|
|
44
|
+
if ('translucent' in androidStatusBar) {
|
|
45
|
+
WarningAggregator().addWarningAndroid(TAG, 'Due to Android edge-to-edge enforcement, `androidStatusBar.translucent` is deprecated and has no effect. This will be removed in a future release.');
|
|
46
|
+
}
|
|
49
47
|
config = withStatusBarStyles(config);
|
|
50
48
|
return config;
|
|
51
49
|
};
|
|
52
50
|
exports.withStatusBar = withStatusBar;
|
|
53
|
-
const withStatusBarColors = config => {
|
|
54
|
-
return (0, _androidPlugins().withAndroidColors)(config, config => {
|
|
55
|
-
config.modResults = setStatusBarColors(config, config.modResults);
|
|
56
|
-
return config;
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
51
|
const withStatusBarStyles = config => {
|
|
60
52
|
return (0, _androidPlugins().withAndroidStyles)(config, config => {
|
|
61
53
|
config.modResults = setStatusBarStyles(config, config.modResults);
|
|
62
54
|
return config;
|
|
63
55
|
});
|
|
64
56
|
};
|
|
65
|
-
function setStatusBarColors(config, colors) {
|
|
66
|
-
return (0, _Colors().assignColorValue)(colors, {
|
|
67
|
-
name: COLOR_PRIMARY_DARK_KEY,
|
|
68
|
-
value: getStatusBarColor(config)
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
57
|
function setStatusBarStyles(config, styles) {
|
|
72
|
-
const hexString = getStatusBarColor(config);
|
|
73
|
-
const floatElement = getStatusBarTranslucent(config);
|
|
74
58
|
styles = (0, _Styles().assignStylesValue)(styles, {
|
|
75
59
|
parent: (0, _Styles().getAppThemeGroup)(),
|
|
76
60
|
name: WINDOW_LIGHT_STATUS_BAR,
|
|
@@ -81,31 +65,11 @@ function setStatusBarStyles(config, styles) {
|
|
|
81
65
|
styles = (0, _Styles().assignStylesValue)(styles, {
|
|
82
66
|
parent: (0, _Styles().getAppThemeGroup)(),
|
|
83
67
|
name: STATUS_BAR_COLOR,
|
|
84
|
-
value:
|
|
85
|
-
|
|
86
|
-
add: floatElement || !!hexString
|
|
68
|
+
value: '@android:color/transparent',
|
|
69
|
+
add: true
|
|
87
70
|
});
|
|
88
71
|
return styles;
|
|
89
72
|
}
|
|
90
|
-
function getStatusBarColor(config) {
|
|
91
|
-
const backgroundColor = config.androidStatusBar?.backgroundColor;
|
|
92
|
-
if (backgroundColor) {
|
|
93
|
-
// Drop support for translucent
|
|
94
|
-
(0, _assert().default)(backgroundColor !== 'translucent', `androidStatusBar.backgroundColor must be a valid hex string, instead got: "${backgroundColor}"`);
|
|
95
|
-
}
|
|
96
|
-
return backgroundColor;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Specifies whether the status bar should be "translucent". When true, the status bar is drawn with `position: absolute` and a gray underlay, when false `position: relative` (pushes content down).
|
|
101
|
-
*
|
|
102
|
-
* @default false
|
|
103
|
-
* @param config
|
|
104
|
-
* @returns
|
|
105
|
-
*/
|
|
106
|
-
function getStatusBarTranslucent(config) {
|
|
107
|
-
return config.androidStatusBar?.translucent ?? false;
|
|
108
|
-
}
|
|
109
73
|
function getStatusBarStyle(config) {
|
|
110
74
|
return config.androidStatusBar?.barStyle || 'light-content';
|
|
111
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.js","names":["
|
|
1
|
+
{"version":3,"file":"StatusBar.js","names":["_Styles","data","require","_androidPlugins","WarningAggregator","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","TAG","WINDOW_LIGHT_STATUS_BAR","STATUS_BAR_COLOR","withStatusBar","config","androidStatusBar","addWarningAndroid","withStatusBarStyles","exports","withAndroidStyles","modResults","setStatusBarStyles","styles","assignStylesValue","parent","getAppThemeGroup","name","value","add","getStatusBarStyle","barStyle"],"sources":["../../src/android/StatusBar.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { ResourceXML } from './Resources';\nimport { assignStylesValue, getAppThemeGroup } from './Styles';\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withAndroidStyles } from '../plugins/android-plugins';\nimport * as WarningAggregator from '../utils/warnings';\n\nconst TAG = 'STATUS_BAR_PLUGIN';\n// https://developer.android.com/reference/android/R.attr#windowLightStatusBar\nconst WINDOW_LIGHT_STATUS_BAR = 'android:windowLightStatusBar';\n// https://developer.android.com/reference/android/R.attr#statusBarColor\nconst STATUS_BAR_COLOR = 'android:statusBarColor';\n\nexport const withStatusBar: ConfigPlugin = (config) => {\n const { androidStatusBar = {} } = config;\n\n if ('backgroundColor' in androidStatusBar) {\n WarningAggregator.addWarningAndroid(\n TAG,\n 'Due to Android edge-to-edge enforcement, `androidStatusBar.backgroundColor` is deprecated and has no effect. This will be removed in a future release.'\n );\n }\n if ('translucent' in androidStatusBar) {\n WarningAggregator.addWarningAndroid(\n TAG,\n 'Due to Android edge-to-edge enforcement, `androidStatusBar.translucent` is deprecated and has no effect. This will be removed in a future release.'\n );\n }\n\n config = withStatusBarStyles(config);\n return config;\n};\n\nconst withStatusBarStyles: ConfigPlugin = (config) => {\n return withAndroidStyles(config, (config) => {\n config.modResults = setStatusBarStyles(config, config.modResults);\n return config;\n });\n};\n\nexport function setStatusBarStyles(\n config: Pick<ExpoConfig, 'androidStatusBar'>,\n styles: ResourceXML\n): ResourceXML {\n styles = assignStylesValue(styles, {\n parent: getAppThemeGroup(),\n name: WINDOW_LIGHT_STATUS_BAR,\n value: 'true',\n // Default is light-content, don't need to do anything to set it\n add: getStatusBarStyle(config) === 'dark-content',\n });\n\n styles = assignStylesValue(styles, {\n parent: getAppThemeGroup(),\n name: STATUS_BAR_COLOR,\n value: '@android:color/transparent',\n add: true,\n });\n\n return styles;\n}\n\nexport function getStatusBarStyle(config: Pick<ExpoConfig, 'androidStatusBar'>) {\n return config.androidStatusBar?.barStyle || 'light-content';\n}\n"],"mappings":";;;;;;;;AAGA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,kBAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,iBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuD,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAA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,SAASO,kBAAkBA,CAChCP,MAA4C,EAC5CQ,MAAmB,EACN;EACbA,MAAM,GAAG,IAAAC,2BAAiB,EAACD,MAAM,EAAE;IACjCE,MAAM,EAAE,IAAAC,0BAAgB,EAAC,CAAC;IAC1BC,IAAI,EAAEf,uBAAuB;IAC7BgB,KAAK,EAAE,MAAM;IACb;IACAC,GAAG,EAAEC,iBAAiB,CAACf,MAAM,CAAC,KAAK;EACrC,CAAC,CAAC;EAEFQ,MAAM,GAAG,IAAAC,2BAAiB,EAACD,MAAM,EAAE;IACjCE,MAAM,EAAE,IAAAC,0BAAgB,EAAC,CAAC;IAC1BC,IAAI,EAAEd,gBAAgB;IACtBe,KAAK,EAAE,4BAA4B;IACnCC,GAAG,EAAE;EACP,CAAC,CAAC;EAEF,OAAON,MAAM;AACf;AAEO,SAASO,iBAAiBA,CAACf,MAA4C,EAAE;EAC9E,OAAOA,MAAM,CAACC,gBAAgB,EAAEe,QAAQ,IAAI,eAAe;AAC7D","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/config-plugins",
|
|
3
|
-
"version": "55.0.
|
|
3
|
+
"version": "55.0.6",
|
|
4
4
|
"description": "A library for Expo config plugins",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"paths"
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@expo/config-types": "^55.0.
|
|
58
|
+
"@expo/config-types": "^55.0.5",
|
|
59
59
|
"@expo/json-file": "~10.0.12",
|
|
60
60
|
"@expo/plist": "^0.5.2",
|
|
61
61
|
"@expo/sdk-runtime-versions": "^1.0.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "b183e5cbd95eb6ee54a878291c7077d8d63e4850"
|
|
81
81
|
}
|