react-native-edge-to-edge 0.0.0 → 0.1.1
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/LICENSE +21 -0
- package/README.md +154 -0
- package/android/build.gradle +73 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +3 -0
- package/android/src/main/java/com/zoontek/rnedgetoedge/RNEdgeToEdgeModuleImpl.kt +120 -0
- package/android/src/main/java/com/zoontek/rnedgetoedge/RNEdgeToEdgePackage.kt +36 -0
- package/android/src/main/res/values/colors.xml +8 -0
- package/android/src/main/res/values/public.xml +4 -0
- package/android/src/main/res/values/styles.xml +16 -0
- package/android/src/main/res/values-night/styles.xml +6 -0
- package/android/src/main/res/values-v26/styles.xml +6 -0
- package/android/src/main/res/values-v27/styles.xml +8 -0
- package/android/src/main/res/values-v29/styles.xml +9 -0
- package/android/src/main/res/values-v30/styles.xml +9 -0
- package/android/src/newarch/com/zoontek/rnedgetoedge/RNEdgeToEdgeModule.kt +37 -0
- package/android/src/oldarch/com/zoontek/rnedgetoedge/RNBarsModule.kt +40 -0
- package/app.plugin.js +1 -0
- package/dist/commonjs/NativeRNEdgeToEdge.js +9 -0
- package/dist/commonjs/NativeRNEdgeToEdge.js.map +1 -0
- package/dist/commonjs/SystemBars.js +180 -0
- package/dist/commonjs/SystemBars.js.map +1 -0
- package/dist/commonjs/expo.js +35 -0
- package/dist/commonjs/expo.js.map +1 -0
- package/dist/commonjs/index.js +32 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/types.js +2 -0
- package/dist/commonjs/types.js.map +1 -0
- package/dist/module/NativeRNEdgeToEdge.js +5 -0
- package/dist/module/NativeRNEdgeToEdge.js.map +1 -0
- package/dist/module/SystemBars.js +175 -0
- package/dist/module/SystemBars.js.map +1 -0
- package/dist/module/expo.js +31 -0
- package/dist/module/expo.js.map +1 -0
- package/dist/module/index.js +5 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/types.js +2 -0
- package/dist/module/types.js.map +1 -0
- package/dist/typescript/NativeRNEdgeToEdge.d.ts +12 -0
- package/dist/typescript/NativeRNEdgeToEdge.d.ts.map +1 -0
- package/dist/typescript/SystemBars.d.ts +8 -0
- package/dist/typescript/SystemBars.d.ts.map +1 -0
- package/dist/typescript/expo.d.ts +4 -0
- package/dist/typescript/expo.d.ts.map +1 -0
- package/dist/typescript/index.d.ts +3 -0
- package/dist/typescript/index.d.ts.map +1 -0
- package/dist/typescript/types.d.ts +14 -0
- package/dist/typescript/types.d.ts.map +1 -0
- package/package.json +73 -6
- package/src/NativeRNEdgeToEdge.ts +14 -0
- package/src/SystemBars.ts +222 -0
- package/src/expo.ts +55 -0
- package/src/index.ts +2 -0
- package/src/types.ts +12 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SystemBars = SystemBars;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _NativeRNEdgeToEdge = _interopRequireDefault(require("./NativeRNEdgeToEdge"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function getColorScheme() {
|
|
12
|
+
return _reactNative.Appearance?.getColorScheme() ?? "light";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Merges the entries stack.
|
|
17
|
+
*/
|
|
18
|
+
function mergeEntriesStack(entriesStack) {
|
|
19
|
+
const mergedEntry = entriesStack.reduce((prev, cur) => {
|
|
20
|
+
for (const prop in cur) {
|
|
21
|
+
if (cur[prop] != null) {
|
|
22
|
+
// @ts-expect-error
|
|
23
|
+
prev[prop] = cur[prop];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return prev;
|
|
27
|
+
}, {
|
|
28
|
+
statusBarStyle: undefined,
|
|
29
|
+
statusBarHidden: undefined,
|
|
30
|
+
navigationBarHidden: undefined
|
|
31
|
+
});
|
|
32
|
+
if (mergedEntry.statusBarStyle == null && mergedEntry.statusBarHidden == null && mergedEntry.navigationBarHidden == null) {
|
|
33
|
+
return null;
|
|
34
|
+
} else {
|
|
35
|
+
return mergedEntry;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Returns an object to insert in the props stack from the props.
|
|
41
|
+
*/
|
|
42
|
+
function createStackEntry(props) {
|
|
43
|
+
return {
|
|
44
|
+
statusBarStyle: props.style,
|
|
45
|
+
statusBarHidden: typeof props.hidden === "boolean" ? props.hidden : props.hidden?.statusBar,
|
|
46
|
+
navigationBarHidden: typeof props.hidden === "boolean" ? props.hidden : props.hidden?.navigationBar
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const entriesStack = [];
|
|
50
|
+
|
|
51
|
+
// Timer for updating the native module values at the end of the frame.
|
|
52
|
+
let updateImmediate = null;
|
|
53
|
+
|
|
54
|
+
// The current merged values from the entries stack.
|
|
55
|
+
let currentMergedEntries = null;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Updates the native system bars with the entries from the stack.
|
|
59
|
+
*/
|
|
60
|
+
function updateEntriesStack() {
|
|
61
|
+
if (updateImmediate != null) {
|
|
62
|
+
clearImmediate(updateImmediate);
|
|
63
|
+
}
|
|
64
|
+
updateImmediate = setImmediate(() => {
|
|
65
|
+
const mergedEntries = mergeEntriesStack(entriesStack);
|
|
66
|
+
if (mergedEntries != null) {
|
|
67
|
+
const {
|
|
68
|
+
statusBarHidden,
|
|
69
|
+
navigationBarHidden
|
|
70
|
+
} = mergedEntries;
|
|
71
|
+
const statusBarStyle = mergedEntries.statusBarStyle === "auto" ? getColorScheme() === "light" ? "dark" : "light" : mergedEntries.statusBarStyle;
|
|
72
|
+
if (currentMergedEntries?.statusBarStyle !== statusBarStyle || currentMergedEntries?.statusBarHidden !== statusBarHidden || currentMergedEntries?.navigationBarHidden !== navigationBarHidden) {
|
|
73
|
+
if (_reactNative.Platform.OS === "android") {
|
|
74
|
+
_NativeRNEdgeToEdge.default?.setSystemBarsConfig({
|
|
75
|
+
statusBarStyle,
|
|
76
|
+
statusBarHidden,
|
|
77
|
+
navigationBarHidden
|
|
78
|
+
});
|
|
79
|
+
} else if (_reactNative.Platform.OS === "ios") {
|
|
80
|
+
// Emulate android behavior with react-native StatusBar
|
|
81
|
+
if (statusBarStyle != null) {
|
|
82
|
+
_reactNative.StatusBar.setBarStyle(`${statusBarStyle}-content`, true);
|
|
83
|
+
}
|
|
84
|
+
if (statusBarHidden != null) {
|
|
85
|
+
_reactNative.StatusBar.setHidden(statusBarHidden, "fade"); // 'slide' doesn't work in this context
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
currentMergedEntries = {
|
|
90
|
+
statusBarStyle,
|
|
91
|
+
statusBarHidden,
|
|
92
|
+
navigationBarHidden
|
|
93
|
+
};
|
|
94
|
+
} else {
|
|
95
|
+
currentMergedEntries = null;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Push a SystemBars entry onto the stack.
|
|
102
|
+
* The return value should be passed to `popStackEntry` when complete.
|
|
103
|
+
*
|
|
104
|
+
* @param props Object containing the SystemBars props to use in the stack entry.
|
|
105
|
+
*/
|
|
106
|
+
function pushStackEntry(props) {
|
|
107
|
+
const entry = createStackEntry(props);
|
|
108
|
+
entriesStack.push(entry);
|
|
109
|
+
updateEntriesStack();
|
|
110
|
+
return entry;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Pop a SystemBars entry from the stack.
|
|
115
|
+
*
|
|
116
|
+
* @param entry Entry returned from `pushStackEntry`.
|
|
117
|
+
*/
|
|
118
|
+
function popStackEntry(entry) {
|
|
119
|
+
const index = entriesStack.indexOf(entry);
|
|
120
|
+
if (index !== -1) {
|
|
121
|
+
entriesStack.splice(index, 1);
|
|
122
|
+
}
|
|
123
|
+
updateEntriesStack();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Replace an existing SystemBars stack entry with new props.
|
|
128
|
+
*
|
|
129
|
+
* @param entry Entry returned from `pushStackEntry` to replace.
|
|
130
|
+
* @param props Object containing the SystemBars props to use in the replacement stack entry.
|
|
131
|
+
*/
|
|
132
|
+
function replaceStackEntry(entry, props) {
|
|
133
|
+
const newEntry = createStackEntry(props);
|
|
134
|
+
const index = entriesStack.indexOf(entry);
|
|
135
|
+
if (index !== -1) {
|
|
136
|
+
entriesStack[index] = newEntry;
|
|
137
|
+
}
|
|
138
|
+
updateEntriesStack();
|
|
139
|
+
return newEntry;
|
|
140
|
+
}
|
|
141
|
+
function SystemBars({
|
|
142
|
+
hidden,
|
|
143
|
+
style
|
|
144
|
+
}) {
|
|
145
|
+
const statusBarHidden = typeof hidden === "boolean" ? hidden : hidden?.statusBar;
|
|
146
|
+
const navigationBarHidden = typeof hidden === "boolean" ? hidden : hidden?.navigationBar;
|
|
147
|
+
const stableProps = (0, _react.useMemo)(() => ({
|
|
148
|
+
hidden: statusBarHidden === navigationBarHidden ? statusBarHidden : {
|
|
149
|
+
statusBar: statusBarHidden,
|
|
150
|
+
navigationBar: navigationBarHidden
|
|
151
|
+
},
|
|
152
|
+
style
|
|
153
|
+
}), [style, statusBarHidden, navigationBarHidden]);
|
|
154
|
+
const colorScheme = (0, _reactNative.useColorScheme)();
|
|
155
|
+
const stackEntryRef = (0, _react.useRef)(null);
|
|
156
|
+
(0, _react.useEffect)(() => {
|
|
157
|
+
// Every time a SystemBars component is mounted, we push it's prop to a stack
|
|
158
|
+
// and always update the native system bars with the props from the top of then
|
|
159
|
+
// stack. This allows having multiple SystemBars components and the one that is
|
|
160
|
+
// added last or is deeper in the view hierarchy will have priority.
|
|
161
|
+
stackEntryRef.current = pushStackEntry(stableProps);
|
|
162
|
+
return () => {
|
|
163
|
+
// When a SystemBars is unmounted, remove itself from the stack and update
|
|
164
|
+
// the native bars with the next props.
|
|
165
|
+
if (stackEntryRef.current) {
|
|
166
|
+
popStackEntry(stackEntryRef.current);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}, []);
|
|
170
|
+
(0, _react.useEffect)(() => {
|
|
171
|
+
if (stackEntryRef.current) {
|
|
172
|
+
stackEntryRef.current = replaceStackEntry(stackEntryRef.current, stableProps);
|
|
173
|
+
}
|
|
174
|
+
}, [colorScheme, stableProps]);
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
SystemBars.pushStackEntry = pushStackEntry;
|
|
178
|
+
SystemBars.popStackEntry = popStackEntry;
|
|
179
|
+
SystemBars.replaceStackEntry = replaceStackEntry;
|
|
180
|
+
//# sourceMappingURL=SystemBars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_NativeRNEdgeToEdge","_interopRequireDefault","e","__esModule","default","getColorScheme","Appearance","mergeEntriesStack","entriesStack","mergedEntry","reduce","prev","cur","prop","statusBarStyle","undefined","statusBarHidden","navigationBarHidden","createStackEntry","props","style","hidden","statusBar","navigationBar","updateImmediate","currentMergedEntries","updateEntriesStack","clearImmediate","setImmediate","mergedEntries","Platform","OS","NativeModule","setSystemBarsConfig","StatusBar","setBarStyle","setHidden","pushStackEntry","entry","push","popStackEntry","index","indexOf","splice","replaceStackEntry","newEntry","SystemBars","stableProps","useMemo","colorScheme","useColorScheme","stackEntryRef","useRef","useEffect","current"],"sourceRoot":"../../src","sources":["SystemBars.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAgD,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,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AAa,EAAEN;IAAoB,CAAC;IACxEG;EACF,CAAC,CAAC,EACF,CAACA,KAAK,EAAEJ,eAAe,EAAEC,mBAAmB,CAC9C,CAAC;EAED,MAAMgC,WAAW,GAAG,IAAAC,2BAAc,EAAC,CAAC;EACpC,MAAMC,aAAa,GAAG,IAAAC,aAAM,EAAyB,IAAI,CAAC;EAE1D,IAAAC,gBAAS,EAAC,MAAM;IACd;IACA;IACA;IACA;IACAF,aAAa,CAACG,OAAO,GAAGjB,cAAc,CAACU,WAAW,CAAC;IAEnD,OAAO,MAAM;MACX;MACA;MACA,IAAII,aAAa,CAACG,OAAO,EAAE;QACzBd,aAAa,CAACW,aAAa,CAACG,OAAO,CAAC;MACtC;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,IAAAD,gBAAS,EAAC,MAAM;IACd,IAAIF,aAAa,CAACG,OAAO,EAAE;MACzBH,aAAa,CAACG,OAAO,GAAGV,iBAAiB,CACvCO,aAAa,CAACG,OAAO,EACrBP,WACF,CAAC;IACH;EACF,CAAC,EAAE,CAACE,WAAW,EAAEF,WAAW,CAAC,CAAC;EAE9B,OAAO,IAAI;AACb;AAEAD,UAAU,CAACT,cAAc,GAAGA,cAAc;AAC1CS,UAAU,CAACN,aAAa,GAAGA,aAAa;AACxCM,UAAU,CAACF,iBAAiB,GAAGA,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _configPlugins = require("@expo/config-plugins");
|
|
8
|
+
const withAndroidEdgeToEdgeTheme = config => {
|
|
9
|
+
const ignoreList = new Set(["android:enforceNavigationBarContrast", "android:enforceStatusBarContrast", "android:fitsSystemWindows", "android:navigationBarColor", "android:statusBarColor", "android:windowDrawsSystemBarBackgrounds", "android:windowLayoutInDisplayCutoutMode", "android:windowLightNavigationBar", "android:windowLightStatusBar", "android:windowTranslucentNavigation", "android:windowTranslucentStatus"]);
|
|
10
|
+
return (0, _configPlugins.withAndroidStyles)(config, config => {
|
|
11
|
+
const {
|
|
12
|
+
userInterfaceStyle = "light"
|
|
13
|
+
} = config;
|
|
14
|
+
config.modResults.resources.style = config.modResults.resources.style?.map(style => {
|
|
15
|
+
if (style.$.name === "AppTheme") {
|
|
16
|
+
style.$.parent = "Theme.EdgeToEdge";
|
|
17
|
+
if (style.item != null) {
|
|
18
|
+
style.item = style.item.filter(item => !ignoreList.has(item.$.name));
|
|
19
|
+
}
|
|
20
|
+
if (userInterfaceStyle !== "automatic") {
|
|
21
|
+
style.item.push({
|
|
22
|
+
$: {
|
|
23
|
+
name: "android:windowLightStatusBar"
|
|
24
|
+
},
|
|
25
|
+
_: String(userInterfaceStyle === "light")
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return style;
|
|
30
|
+
});
|
|
31
|
+
return config;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var _default = exports.default = (0, _configPlugins.createRunOncePlugin)(withAndroidEdgeToEdgeTheme, "react-native-edge-to-edge");
|
|
35
|
+
//# sourceMappingURL=expo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","withAndroidEdgeToEdgeTheme","config","ignoreList","Set","withAndroidStyles","userInterfaceStyle","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String","_default","exports","default","createRunOncePlugin"],"sourceRoot":"../../src","sources":["expo.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAMA,MAAMC,0BAAwC,GAAIC,MAAM,IAAK;EAC3D,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAC,CACzB,sCAAsC,EACtC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,yCAAyC,EACzC,yCAAyC,EACzC,kCAAkC,EAClC,8BAA8B,EAC9B,qCAAqC,EACrC,iCAAiC,CAClC,CAAC;EAEF,OAAO,IAAAC,gCAAiB,EAACH,MAAM,EAAGA,MAAM,IAAK;IAC3C,MAAM;MAAEI,kBAAkB,GAAG;IAAQ,CAAC,GAAGJ,MAAM;IAE/CA,MAAM,CAACK,UAAU,CAACC,SAAS,CAACC,KAAK,GAAGP,MAAM,CAACK,UAAU,CAACC,SAAS,CAACC,KAAK,EAAEC,GAAG,CACvED,KAAK,IAAmB;MACvB,IAAIA,KAAK,CAACE,CAAC,CAACC,IAAI,KAAK,UAAU,EAAE;QAC/BH,KAAK,CAACE,CAAC,CAACE,MAAM,GAAG,kBAAkB;QAEnC,IAAIJ,KAAK,CAACK,IAAI,IAAI,IAAI,EAAE;UACtBL,KAAK,CAACK,IAAI,GAAGL,KAAK,CAACK,IAAI,CAACC,MAAM,CAC3BD,IAAI,IAAK,CAACX,UAAU,CAACa,GAAG,CAACF,IAAI,CAACH,CAAC,CAACC,IAAI,CACvC,CAAC;QACH;QAEA,IAAIN,kBAAkB,KAAK,WAAW,EAAE;UACtCG,KAAK,CAACK,IAAI,CAACG,IAAI,CAAC;YACdN,CAAC,EAAE;cAAEC,IAAI,EAAE;YAA+B,CAAC;YAC3CM,CAAC,EAAEC,MAAM,CAACb,kBAAkB,KAAK,OAAO;UAC1C,CAAC,CAAC;QACJ;MACF;MAEA,OAAOG,KAAK;IACd,CACF,CAAC;IAED,OAAOP,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC,IAAAkB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,kCAAmB,EAChCtB,0BAA0B,EAC1B,2BACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "SystemBarStyle", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _types.SystemBarStyle;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "SystemBars", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _SystemBars.SystemBars;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "SystemBarsEntry", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _types.SystemBarsEntry;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "SystemBarsProps", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _types.SystemBarsProps;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _SystemBars = require("./SystemBars");
|
|
31
|
+
var _types = require("./types");
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_SystemBars","require","_types"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativeRNEdgeToEdge.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAYlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,cAAc,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
4
|
+
import { Appearance, Platform, StatusBar, useColorScheme } from "react-native";
|
|
5
|
+
import NativeModule from "./NativeRNEdgeToEdge";
|
|
6
|
+
function getColorScheme() {
|
|
7
|
+
return Appearance?.getColorScheme() ?? "light";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Merges the entries stack.
|
|
12
|
+
*/
|
|
13
|
+
function mergeEntriesStack(entriesStack) {
|
|
14
|
+
const mergedEntry = entriesStack.reduce((prev, cur) => {
|
|
15
|
+
for (const prop in cur) {
|
|
16
|
+
if (cur[prop] != null) {
|
|
17
|
+
// @ts-expect-error
|
|
18
|
+
prev[prop] = cur[prop];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return prev;
|
|
22
|
+
}, {
|
|
23
|
+
statusBarStyle: undefined,
|
|
24
|
+
statusBarHidden: undefined,
|
|
25
|
+
navigationBarHidden: undefined
|
|
26
|
+
});
|
|
27
|
+
if (mergedEntry.statusBarStyle == null && mergedEntry.statusBarHidden == null && mergedEntry.navigationBarHidden == null) {
|
|
28
|
+
return null;
|
|
29
|
+
} else {
|
|
30
|
+
return mergedEntry;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Returns an object to insert in the props stack from the props.
|
|
36
|
+
*/
|
|
37
|
+
function createStackEntry(props) {
|
|
38
|
+
return {
|
|
39
|
+
statusBarStyle: props.style,
|
|
40
|
+
statusBarHidden: typeof props.hidden === "boolean" ? props.hidden : props.hidden?.statusBar,
|
|
41
|
+
navigationBarHidden: typeof props.hidden === "boolean" ? props.hidden : props.hidden?.navigationBar
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const entriesStack = [];
|
|
45
|
+
|
|
46
|
+
// Timer for updating the native module values at the end of the frame.
|
|
47
|
+
let updateImmediate = null;
|
|
48
|
+
|
|
49
|
+
// The current merged values from the entries stack.
|
|
50
|
+
let currentMergedEntries = null;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Updates the native system bars with the entries from the stack.
|
|
54
|
+
*/
|
|
55
|
+
function updateEntriesStack() {
|
|
56
|
+
if (updateImmediate != null) {
|
|
57
|
+
clearImmediate(updateImmediate);
|
|
58
|
+
}
|
|
59
|
+
updateImmediate = setImmediate(() => {
|
|
60
|
+
const mergedEntries = mergeEntriesStack(entriesStack);
|
|
61
|
+
if (mergedEntries != null) {
|
|
62
|
+
const {
|
|
63
|
+
statusBarHidden,
|
|
64
|
+
navigationBarHidden
|
|
65
|
+
} = mergedEntries;
|
|
66
|
+
const statusBarStyle = mergedEntries.statusBarStyle === "auto" ? getColorScheme() === "light" ? "dark" : "light" : mergedEntries.statusBarStyle;
|
|
67
|
+
if (currentMergedEntries?.statusBarStyle !== statusBarStyle || currentMergedEntries?.statusBarHidden !== statusBarHidden || currentMergedEntries?.navigationBarHidden !== navigationBarHidden) {
|
|
68
|
+
if (Platform.OS === "android") {
|
|
69
|
+
NativeModule?.setSystemBarsConfig({
|
|
70
|
+
statusBarStyle,
|
|
71
|
+
statusBarHidden,
|
|
72
|
+
navigationBarHidden
|
|
73
|
+
});
|
|
74
|
+
} else if (Platform.OS === "ios") {
|
|
75
|
+
// Emulate android behavior with react-native StatusBar
|
|
76
|
+
if (statusBarStyle != null) {
|
|
77
|
+
StatusBar.setBarStyle(`${statusBarStyle}-content`, true);
|
|
78
|
+
}
|
|
79
|
+
if (statusBarHidden != null) {
|
|
80
|
+
StatusBar.setHidden(statusBarHidden, "fade"); // 'slide' doesn't work in this context
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
currentMergedEntries = {
|
|
85
|
+
statusBarStyle,
|
|
86
|
+
statusBarHidden,
|
|
87
|
+
navigationBarHidden
|
|
88
|
+
};
|
|
89
|
+
} else {
|
|
90
|
+
currentMergedEntries = null;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Push a SystemBars entry onto the stack.
|
|
97
|
+
* The return value should be passed to `popStackEntry` when complete.
|
|
98
|
+
*
|
|
99
|
+
* @param props Object containing the SystemBars props to use in the stack entry.
|
|
100
|
+
*/
|
|
101
|
+
function pushStackEntry(props) {
|
|
102
|
+
const entry = createStackEntry(props);
|
|
103
|
+
entriesStack.push(entry);
|
|
104
|
+
updateEntriesStack();
|
|
105
|
+
return entry;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Pop a SystemBars entry from the stack.
|
|
110
|
+
*
|
|
111
|
+
* @param entry Entry returned from `pushStackEntry`.
|
|
112
|
+
*/
|
|
113
|
+
function popStackEntry(entry) {
|
|
114
|
+
const index = entriesStack.indexOf(entry);
|
|
115
|
+
if (index !== -1) {
|
|
116
|
+
entriesStack.splice(index, 1);
|
|
117
|
+
}
|
|
118
|
+
updateEntriesStack();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Replace an existing SystemBars stack entry with new props.
|
|
123
|
+
*
|
|
124
|
+
* @param entry Entry returned from `pushStackEntry` to replace.
|
|
125
|
+
* @param props Object containing the SystemBars props to use in the replacement stack entry.
|
|
126
|
+
*/
|
|
127
|
+
function replaceStackEntry(entry, props) {
|
|
128
|
+
const newEntry = createStackEntry(props);
|
|
129
|
+
const index = entriesStack.indexOf(entry);
|
|
130
|
+
if (index !== -1) {
|
|
131
|
+
entriesStack[index] = newEntry;
|
|
132
|
+
}
|
|
133
|
+
updateEntriesStack();
|
|
134
|
+
return newEntry;
|
|
135
|
+
}
|
|
136
|
+
export function SystemBars({
|
|
137
|
+
hidden,
|
|
138
|
+
style
|
|
139
|
+
}) {
|
|
140
|
+
const statusBarHidden = typeof hidden === "boolean" ? hidden : hidden?.statusBar;
|
|
141
|
+
const navigationBarHidden = typeof hidden === "boolean" ? hidden : hidden?.navigationBar;
|
|
142
|
+
const stableProps = useMemo(() => ({
|
|
143
|
+
hidden: statusBarHidden === navigationBarHidden ? statusBarHidden : {
|
|
144
|
+
statusBar: statusBarHidden,
|
|
145
|
+
navigationBar: navigationBarHidden
|
|
146
|
+
},
|
|
147
|
+
style
|
|
148
|
+
}), [style, statusBarHidden, navigationBarHidden]);
|
|
149
|
+
const colorScheme = useColorScheme();
|
|
150
|
+
const stackEntryRef = useRef(null);
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
// Every time a SystemBars component is mounted, we push it's prop to a stack
|
|
153
|
+
// and always update the native system bars with the props from the top of then
|
|
154
|
+
// stack. This allows having multiple SystemBars components and the one that is
|
|
155
|
+
// added last or is deeper in the view hierarchy will have priority.
|
|
156
|
+
stackEntryRef.current = pushStackEntry(stableProps);
|
|
157
|
+
return () => {
|
|
158
|
+
// When a SystemBars is unmounted, remove itself from the stack and update
|
|
159
|
+
// the native bars with the next props.
|
|
160
|
+
if (stackEntryRef.current) {
|
|
161
|
+
popStackEntry(stackEntryRef.current);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}, []);
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (stackEntryRef.current) {
|
|
167
|
+
stackEntryRef.current = replaceStackEntry(stackEntryRef.current, stableProps);
|
|
168
|
+
}
|
|
169
|
+
}, [colorScheme, stableProps]);
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
SystemBars.pushStackEntry = pushStackEntry;
|
|
173
|
+
SystemBars.popStackEntry = popStackEntry;
|
|
174
|
+
SystemBars.replaceStackEntry = replaceStackEntry;
|
|
175
|
+
//# sourceMappingURL=SystemBars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useMemo","useRef","Appearance","Platform","StatusBar","useColorScheme","NativeModule","getColorScheme","mergeEntriesStack","entriesStack","mergedEntry","reduce","prev","cur","prop","statusBarStyle","undefined","statusBarHidden","navigationBarHidden","createStackEntry","props","style","hidden","statusBar","navigationBar","updateImmediate","currentMergedEntries","updateEntriesStack","clearImmediate","setImmediate","mergedEntries","OS","setSystemBarsConfig","setBarStyle","setHidden","pushStackEntry","entry","push","popStackEntry","index","indexOf","splice","replaceStackEntry","newEntry","SystemBars","stableProps","colorScheme","stackEntryRef","current"],"sourceRoot":"../../src","sources":["SystemBars.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAClD,SAASC,UAAU,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,cAAc,QAAQ,cAAc;AAC9E,OAAOC,YAAY,MAAM,sBAAsB;AAG/C,SAASC,cAAcA,CAAA,EAAqB;EAC1C,OAAOL,UAAU,EAAEK,cAAc,CAAC,CAAC,IAAI,OAAO;AAChD;;AAEA;AACA;AACA;AACA,SAASC,iBAAiBA,CACxBC,YAA+B,EACP;EACxB,MAAMC,WAAW,GAAGD,YAAY,CAACE,MAAM,CACrC,CAACC,IAAI,EAAEC,GAAG,KAAK;IACb,KAAK,MAAMC,IAAI,IAAID,GAAG,EAAE;MACtB,IAAIA,GAAG,CAACC,IAAI,CAA0B,IAAI,IAAI,EAAE;QAC9C;QACAF,IAAI,CAACE,IAAI,CAAC,GAAGD,GAAG,CAACC,IAAI,CAAC;MACxB;IACF;IACA,OAAOF,IAAI;EACb,CAAC,EACD;IACEG,cAAc,EAAEC,SAAS;IACzBC,eAAe,EAAED,SAAS;IAC1BE,mBAAmB,EAAEF;EACvB,CACF,CAAC;EAED,IACEN,WAAW,CAACK,cAAc,IAAI,IAAI,IAClCL,WAAW,CAACO,eAAe,IAAI,IAAI,IACnCP,WAAW,CAACQ,mBAAmB,IAAI,IAAI,EACvC;IACA,OAAO,IAAI;EACb,CAAC,MAAM;IACL,OAAOR,WAAW;EACpB;AACF;;AAEA;AACA;AACA;AACA,SAASS,gBAAgBA,CAACC,KAAsB,EAAmB;EACjE,OAAO;IACLL,cAAc,EAAEK,KAAK,CAACC,KAAK;IAC3BJ,eAAe,EACb,OAAOG,KAAK,CAACE,MAAM,KAAK,SAAS,GAC7BF,KAAK,CAACE,MAAM,GACZF,KAAK,CAAC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AAGA,MAAM,EAAEC,SAAS;EAC1D,MAAML,mBAAmB,GACvB,OAAOI,MAAM,KAAK,SAAS,GAAGA,MAAM,GAAGA,MAAM,EAAEE,aAAa;EAE9D,MAAMqB,WAAW,GAAG7C,OAAO,CACzB,OAAO;IACLsB,MAAM,EACJL,eAAe,KAAKC,mBAAmB,GACnCD,eAAe,GACf;MAAEM,SAAS,EAAEN,eAAe;MAAEO,aAAa,EAAEN;IAAoB,CAAC;IACxEG;EACF,CAAC,CAAC,EACF,CAACA,KAAK,EAAEJ,eAAe,EAAEC,mBAAmB,CAC9C,CAAC;EAED,MAAM4B,WAAW,GAAGzC,cAAc,CAAC,CAAC;EACpC,MAAM0C,aAAa,GAAG9C,MAAM,CAAyB,IAAI,CAAC;EAE1DF,SAAS,CAAC,MAAM;IACd;IACA;IACA;IACA;IACAgD,aAAa,CAACC,OAAO,GAAGb,cAAc,CAACU,WAAW,CAAC;IAEnD,OAAO,MAAM;MACX;MACA;MACA,IAAIE,aAAa,CAACC,OAAO,EAAE;QACzBV,aAAa,CAACS,aAAa,CAACC,OAAO,CAAC;MACtC;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAENjD,SAAS,CAAC,MAAM;IACd,IAAIgD,aAAa,CAACC,OAAO,EAAE;MACzBD,aAAa,CAACC,OAAO,GAAGN,iBAAiB,CACvCK,aAAa,CAACC,OAAO,EACrBH,WACF,CAAC;IACH;EACF,CAAC,EAAE,CAACC,WAAW,EAAED,WAAW,CAAC,CAAC;EAE9B,OAAO,IAAI;AACb;AAEAD,UAAU,CAACT,cAAc,GAAGA,cAAc;AAC1CS,UAAU,CAACN,aAAa,GAAGA,aAAa;AACxCM,UAAU,CAACF,iBAAiB,GAAGA,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createRunOncePlugin, withAndroidStyles } from "@expo/config-plugins";
|
|
4
|
+
const withAndroidEdgeToEdgeTheme = config => {
|
|
5
|
+
const ignoreList = new Set(["android:enforceNavigationBarContrast", "android:enforceStatusBarContrast", "android:fitsSystemWindows", "android:navigationBarColor", "android:statusBarColor", "android:windowDrawsSystemBarBackgrounds", "android:windowLayoutInDisplayCutoutMode", "android:windowLightNavigationBar", "android:windowLightStatusBar", "android:windowTranslucentNavigation", "android:windowTranslucentStatus"]);
|
|
6
|
+
return withAndroidStyles(config, config => {
|
|
7
|
+
const {
|
|
8
|
+
userInterfaceStyle = "light"
|
|
9
|
+
} = config;
|
|
10
|
+
config.modResults.resources.style = config.modResults.resources.style?.map(style => {
|
|
11
|
+
if (style.$.name === "AppTheme") {
|
|
12
|
+
style.$.parent = "Theme.EdgeToEdge";
|
|
13
|
+
if (style.item != null) {
|
|
14
|
+
style.item = style.item.filter(item => !ignoreList.has(item.$.name));
|
|
15
|
+
}
|
|
16
|
+
if (userInterfaceStyle !== "automatic") {
|
|
17
|
+
style.item.push({
|
|
18
|
+
$: {
|
|
19
|
+
name: "android:windowLightStatusBar"
|
|
20
|
+
},
|
|
21
|
+
_: String(userInterfaceStyle === "light")
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return style;
|
|
26
|
+
});
|
|
27
|
+
return config;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export default createRunOncePlugin(withAndroidEdgeToEdgeTheme, "react-native-edge-to-edge");
|
|
31
|
+
//# sourceMappingURL=expo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createRunOncePlugin","withAndroidStyles","withAndroidEdgeToEdgeTheme","config","ignoreList","Set","userInterfaceStyle","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String"],"sourceRoot":"../../src","sources":["expo.ts"],"mappings":";;AAAA,SAEEA,mBAAmB,EACnBC,iBAAiB,QACZ,sBAAsB;AAE7B,MAAMC,0BAAwC,GAAIC,MAAM,IAAK;EAC3D,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAC,CACzB,sCAAsC,EACtC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,yCAAyC,EACzC,yCAAyC,EACzC,kCAAkC,EAClC,8BAA8B,EAC9B,qCAAqC,EACrC,iCAAiC,CAClC,CAAC;EAEF,OAAOJ,iBAAiB,CAACE,MAAM,EAAGA,MAAM,IAAK;IAC3C,MAAM;MAAEG,kBAAkB,GAAG;IAAQ,CAAC,GAAGH,MAAM;IAE/CA,MAAM,CAACI,UAAU,CAACC,SAAS,CAACC,KAAK,GAAGN,MAAM,CAACI,UAAU,CAACC,SAAS,CAACC,KAAK,EAAEC,GAAG,CACvED,KAAK,IAAmB;MACvB,IAAIA,KAAK,CAACE,CAAC,CAACC,IAAI,KAAK,UAAU,EAAE;QAC/BH,KAAK,CAACE,CAAC,CAACE,MAAM,GAAG,kBAAkB;QAEnC,IAAIJ,KAAK,CAACK,IAAI,IAAI,IAAI,EAAE;UACtBL,KAAK,CAACK,IAAI,GAAGL,KAAK,CAACK,IAAI,CAACC,MAAM,CAC3BD,IAAI,IAAK,CAACV,UAAU,CAACY,GAAG,CAACF,IAAI,CAACH,CAAC,CAACC,IAAI,CACvC,CAAC;QACH;QAEA,IAAIN,kBAAkB,KAAK,WAAW,EAAE;UACtCG,KAAK,CAACK,IAAI,CAACG,IAAI,CAAC;YACdN,CAAC,EAAE;cAAEC,IAAI,EAAE;YAA+B,CAAC;YAC3CM,CAAC,EAAEC,MAAM,CAACb,kBAAkB,KAAK,OAAO;UAC1C,CAAC,CAAC;QACJ;MACF;MAEA,OAAOG,KAAK;IACd,CACF,CAAC;IAED,OAAON,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAED,eAAeH,mBAAmB,CAChCE,0BAA0B,EAC1B,2BACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SystemBars","SystemBarStyle","SystemBarsEntry","SystemBarsProps"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,cAAc,EAAEC,eAAe,EAAEC,eAAe,QAAQ,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TurboModule } from "react-native";
|
|
2
|
+
type SystemBarsConfig = {
|
|
3
|
+
statusBarHidden: boolean | undefined;
|
|
4
|
+
statusBarStyle: string | undefined;
|
|
5
|
+
navigationBarHidden: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
export interface Spec extends TurboModule {
|
|
8
|
+
setSystemBarsConfig(config: SystemBarsConfig): void;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: Spec | null;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=NativeRNEdgeToEdge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeRNEdgeToEdge.d.ts","sourceRoot":"","sources":["../../src/NativeRNEdgeToEdge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,KAAK,gBAAgB,GAAG;IACtB,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrD;;AAED,wBAA6D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SystemBarsEntry, SystemBarsProps } from "./types";
|
|
2
|
+
export declare function SystemBars({ hidden, style }: SystemBarsProps): null;
|
|
3
|
+
export declare namespace SystemBars {
|
|
4
|
+
var pushStackEntry: (props: SystemBarsProps) => SystemBarsEntry;
|
|
5
|
+
var popStackEntry: (entry: SystemBarsEntry) => void;
|
|
6
|
+
var replaceStackEntry: (entry: SystemBarsEntry, props: SystemBarsProps) => SystemBarsEntry;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=SystemBars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemBars.d.ts","sourceRoot":"","sources":["../../src/SystemBars.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAwK3D,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,eAAe,QA8C5D;yBA9Ce,UAAU;gCAvCK,eAAe,KAAG,eAAe;+BAYlC,eAAe,KAAG,IAAI;mCAe3C,eAAe,SACf,eAAe,KACrB,eAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../../src/expo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,sBAAsB,CAAC;;AA+C9B,wBAGE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type SystemBarStyle = "auto" | "light" | "dark";
|
|
2
|
+
export type SystemBarsEntry = {
|
|
3
|
+
statusBarHidden: boolean | undefined;
|
|
4
|
+
statusBarStyle: SystemBarStyle | undefined;
|
|
5
|
+
navigationBarHidden: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
export type SystemBarsProps = {
|
|
8
|
+
style?: SystemBarStyle;
|
|
9
|
+
hidden?: boolean | {
|
|
10
|
+
statusBar?: boolean;
|
|
11
|
+
navigationBar?: boolean;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACrE,CAAC"}
|