@codeleap/mobile 2.2.6 → 2.2.8
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/dist/utils/KeyboardAware/context.js +1 -1
- package/dist/utils/KeyboardAware/context.js.map +1 -1
- package/dist/utils/theme.d.ts +31 -26
- package/dist/utils/theme.js +3 -3
- package/dist/utils/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/KeyboardAware/context.tsx +1 -1
- package/src/utils/theme.ts +9 -4
|
@@ -55,7 +55,7 @@ var KeyboardProvider = function (_a) {
|
|
|
55
55
|
adjustKeyboard = Theme.values.safeAreaTop;
|
|
56
56
|
}
|
|
57
57
|
var height = (_c = (_b = keyboardEvent === null || keyboardEvent === void 0 ? void 0 : keyboardEvent.endCoordinates) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 0;
|
|
58
|
-
var _return = __assign({ event: keyboardEvent, isVisible: keyboardVisible, height: height ? height + adjustKeyboard : 0 }, react_native_1.Keyboard);
|
|
58
|
+
var _return = __assign({ event: keyboardEvent, isVisible: keyboardVisible, height: (!!height && keyboardVisible) ? height + adjustKeyboard : 0 }, react_native_1.Keyboard);
|
|
59
59
|
return <exports.KeyboardCtx.Provider value={_return}>
|
|
60
60
|
{children}
|
|
61
61
|
</exports.KeyboardCtx.Provider>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/utils/KeyboardAware/context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,2CAAsF;AACtF,6CAKqB;AAWR,QAAA,WAAW,GAAG,eAAK,CAAC,aAAa,CAAC,EAAkB,CAAC,CAAA;AAE3D,IAAM,gBAAgB,GAAG,UAAC,EAAY;;QAAV,QAAQ,cAAA;IACnC,IAAA,KAAoC,IAAA,iBAAQ,EAAgB,IAAI,CAAC,EAAhE,aAAa,QAAA,EAAE,gBAAgB,QAAiC,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ight: number;
|
|
3
|
+
tabBarHeight: number;
|
|
4
|
+
};
|
|
5
|
+
export declare function getMobileThemeValues(initialWindowMetrics: any, values: AppValues): {
|
|
6
|
+
pixel: number;
|
|
7
|
+
hasNotch: boolean;
|
|
8
|
+
prefersConstantNavigationBar: boolean;
|
|
9
|
+
safeAreaTop: number;
|
|
10
|
+
safeAreaBottom: number;
|
|
11
|
+
keyboardVerticalOffset: number;
|
|
12
|
+
headerHeight: number;
|
|
13
|
+
tabBarHeight: any;
|
|
14
|
+
bottomNavHeight: any;
|
|
15
|
+
window: {
|
|
12
16
|
height: number;
|
|
13
17
|
width: number;
|
|
14
18
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
transitions: {
|
|
20
|
+
modal: {
|
|
21
|
+
duration: number;
|
|
22
|
+
type: string;
|
|
19
23
|
};
|
|
20
24
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
buttons: {
|
|
26
|
+
small: {
|
|
27
|
+
height: number;
|
|
24
28
|
};
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
default: {
|
|
30
|
+
height: number;
|
|
27
31
|
};
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
large: {
|
|
33
|
+
height: number;
|
|
30
34
|
};
|
|
31
35
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
scale: number;
|
|
39
|
+
fontScale: number;
|
|
36
40
|
};
|
|
41
|
+
export {};
|
package/dist/utils/theme.js
CHANGED
|
@@ -13,7 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.getMobileThemeValues = void 0;
|
|
15
15
|
var react_native_1 = require("react-native");
|
|
16
|
-
function getMobileThemeValues(initialWindowMetrics) {
|
|
16
|
+
function getMobileThemeValues(initialWindowMetrics, values) {
|
|
17
17
|
var _a, _b;
|
|
18
18
|
var screenDimensions = react_native_1.Dimensions.get('screen');
|
|
19
19
|
var hasNotch = react_native_1.Platform.OS === 'ios' ? (react_native_1.Dimensions.get('window').height >= 812) : (((_a = initialWindowMetrics === null || initialWindowMetrics === void 0 ? void 0 : initialWindowMetrics.insets) === null || _a === void 0 ? void 0 : _a.top) > 24 || react_native_1.StatusBar.currentHeight > 24);
|
|
@@ -21,8 +21,8 @@ function getMobileThemeValues(initialWindowMetrics) {
|
|
|
21
21
|
var prefersConstantNavigationBar = bottomNavHeight > 0;
|
|
22
22
|
var safeAreaTop = react_native_1.Platform.OS === 'ios' ? (hasNotch ? 34 : 20) : react_native_1.StatusBar.currentHeight;
|
|
23
23
|
var safeAreaBottom = (hasNotch && !prefersConstantNavigationBar ? 20 : 0);
|
|
24
|
-
return __assign(__assign({}, screenDimensions), { pixel: react_native_1.StyleSheet.hairlineWidth, hasNotch: hasNotch, prefersConstantNavigationBar: prefersConstantNavigationBar, safeAreaTop: safeAreaTop, safeAreaBottom: safeAreaBottom, keyboardVerticalOffset: react_native_1.Platform.OS === 'ios' ? 57 : 47, get headerHeight() { return
|
|
25
|
-
get tabBarHeight() { return
|
|
24
|
+
return __assign(__assign({}, screenDimensions), { pixel: react_native_1.StyleSheet.hairlineWidth, hasNotch: hasNotch, prefersConstantNavigationBar: prefersConstantNavigationBar, safeAreaTop: safeAreaTop, safeAreaBottom: safeAreaBottom, keyboardVerticalOffset: react_native_1.Platform.OS === 'ios' ? 57 : 47, get headerHeight() { return values.headerHeight; },
|
|
25
|
+
get tabBarHeight() { return values.tabBarHeight + (prefersConstantNavigationBar ? 0 : this.safeAreaBottom); }, bottomNavHeight: bottomNavHeight, get window() {
|
|
26
26
|
return {
|
|
27
27
|
height: screenDimensions.height - (bottomNavHeight + safeAreaTop),
|
|
28
28
|
width: screenDimensions.width,
|
package/dist/utils/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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,UAAA,EACR,4BAA4B,8BAAA,EAC5B,WAAW,aAAA,EACX,cAAc,gBAAA,EACd,sBAAsB,EAAE,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EACvD,IAAI,YAAY,KAAK,OAAO,MAAM,CAAC,YAAY,CAAA,CAAC,CAAC;QACjD,IAAI,YAAY,KAAK,OAAO,MAAM,CAAC,YAAY,GAAG,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA,CAAC,CAAC,EAC5G,eAAe,iBAAA,EACf,IAAI,MAAM;YACR,OAAO;gBACL,MAAM,EAAE,gBAAgB,CAAC,MAAM,GAAG,CAAC,eAAe,GAAG,WAAW,CAAC;gBACjE,KAAK,EAAE,gBAAgB,CAAC,KAAK;aAC9B,CAAA;QACH,CAAC,EACD,WAAW,EAAE;YACX,KAAK,EAAE;gBACL,QAAQ,EAAE,GAAG;gBACb,IAAI,EAAE,QAAQ;aACf;SACF,EACD,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE;aACX;YACD,OAAO,EAAE;gBACP,MAAM,EAAE,EAAE;aACX;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE;aACX;SACF,IACF;AACH,CAAC;AA/CD,oDA+CC"}
|
package/package.json
CHANGED
|
@@ -60,7 +60,7 @@ export const KeyboardProvider = ({ children }) => {
|
|
|
60
60
|
const _return = {
|
|
61
61
|
event: keyboardEvent,
|
|
62
62
|
isVisible: keyboardVisible,
|
|
63
|
-
height: height ? height + adjustKeyboard : 0,
|
|
63
|
+
height: (!!height && keyboardVisible) ? height + adjustKeyboard : 0,
|
|
64
64
|
...Keyboard,
|
|
65
65
|
}
|
|
66
66
|
|
package/src/utils/theme.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Platform, Dimensions, StatusBar, StyleSheet } from 'react-native'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type AppValues = {
|
|
4
|
+
headerHeight: number
|
|
5
|
+
tabBarHeight: number
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function getMobileThemeValues(initialWindowMetrics, values: AppValues) {
|
|
4
9
|
const screenDimensions = Dimensions.get('screen')
|
|
5
10
|
|
|
6
11
|
const hasNotch = Platform.OS === 'ios' ? (Dimensions.get('window').height >= 812) : (initialWindowMetrics?.insets?.top > 24 || StatusBar.currentHeight > 24)
|
|
@@ -20,8 +25,8 @@ export function getMobileThemeValues(initialWindowMetrics) {
|
|
|
20
25
|
safeAreaTop,
|
|
21
26
|
safeAreaBottom,
|
|
22
27
|
keyboardVerticalOffset: Platform.OS === 'ios' ? 57 : 47,
|
|
23
|
-
get headerHeight() { return
|
|
24
|
-
get tabBarHeight() { return
|
|
28
|
+
get headerHeight() { return values.headerHeight },
|
|
29
|
+
get tabBarHeight() { return values.tabBarHeight + (prefersConstantNavigationBar ? 0 : this.safeAreaBottom) },
|
|
25
30
|
bottomNavHeight,
|
|
26
31
|
get window() {
|
|
27
32
|
return {
|
|
@@ -46,5 +51,5 @@ export function getMobileThemeValues(initialWindowMetrics) {
|
|
|
46
51
|
height: 60,
|
|
47
52
|
},
|
|
48
53
|
},
|
|
49
|
-
}
|
|
54
|
+
}
|
|
50
55
|
}
|