react-native-unit-components 3.1.1 → 3.1.2-beta.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/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +3 -26
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +37 -37
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +6 -4
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +7 -6
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js +21 -12
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js +4 -2
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js.map +1 -1
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdkManager.js +1 -1
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdkManager.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +4 -27
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +38 -38
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +6 -4
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +6 -5
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
- package/lib/module/helpers/BottomSheet/BottomSheet.js +22 -13
- package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/helpers/BottomSheet/BottomSheet.styles.js +4 -2
- package/lib/module/helpers/BottomSheet/BottomSheet.styles.js.map +1 -1
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdkManager.js +1 -1
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdkManager.js.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.d.ts +1 -0
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.d.ts +1 -0
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.d.ts.map +1 -1
- package/lib/typescript/src/helpers/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/helpers/BottomSheet/BottomSheet.styles.d.ts +4 -2
- package/lib/typescript/src/helpers/BottomSheet/BottomSheet.styles.d.ts.map +1 -1
- package/lib/typescript/src/unitComponentsSdkManager/UnitComponentsSdkManager.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.ts +4 -29
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +58 -53
- package/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.tsx +7 -4
- package/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.tsx +8 -5
- package/src/helpers/BottomSheet/BottomSheet.styles.ts +4 -2
- package/src/helpers/BottomSheet/BottomSheet.tsx +21 -10
- package/src/unitComponentsSdkManager/UnitComponentsSdkManager.ts +1 -1
|
@@ -14,7 +14,7 @@ import UNSnapshotProtectionHelper from '../nativeModulesHelpers/UNSanpshotProtec
|
|
|
14
14
|
import { loadIosFontBase64 } from '../nativeModulesHelpers/UNFontFileHelper/UNFontFileHelper';
|
|
15
15
|
export class UnitComponentsSDK {
|
|
16
16
|
static securitySettings = UNComponentsSDKConstants.securitySettings;
|
|
17
|
-
static sdkVersion = '3.1.1';
|
|
17
|
+
static sdkVersion = '3.1.2-beta.1';
|
|
18
18
|
static iosFontBase64Map = {};
|
|
19
19
|
static init = async (env, theme, language, fonts, webVersioningStrategy = UNComponentsSDKConstants.webSDKRecommendedStrategy, securitySettings = UNComponentsSDKConstants.securitySettings) => {
|
|
20
20
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","fetchUnitScript","UnitComponentsUiManager","warnClientIfNeeded","UNComponentsSDKConstants","setTheme","setLanguage","setCustomerToken","store","UserDataKeys","UNStoreManagerHelper","UnitComponentsHelpersManager","UNSecurityManagerHelper","UNComponentsSnapshotProtectionStrategy","UNSnapshotProtectionHelper","loadIosFontBase64","UnitComponentsSDK","securitySettings","sdkVersion","iosFontBase64Map","init","env","theme","language","fonts","webVersioningStrategy","webSDKRecommendedStrategy","ui","helpers","isJailbroke","isDeviceJailbroke","Error","OS","dispatch","shouldProtectFromSnapshot","snapshotProtectionStrategy","None","setIosSecurity","e","console","log","isInitialized","undefined","setPushProvisioningModule","pushProvisionModule","getPushProvisionModule","getSecuritySettings","setSignedNonce","signedNonce","getEnv","getWebVersioningStrategy","getFonts","getSignedNonce","customerToken","getSdkVersion","cleanUserData","cleanValue","unitCustomerToken","unitVerifiedCustomerToken","unitApplicationFormVerifiedToken"],"sourceRoot":"../../../src","sources":["unitComponentsSdkManager/UnitComponentsSdkManager.ts"],"mappings":"AAAA,SAAwBA,QAAQ,QAAQ,cAAc;AACtD,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,uBAAuB,QAAQ,mDAAmD;AAE3F,SAASC,kBAAkB,QAAQ,sCAAsC;AACzE,SAASC,wBAAwB,QAAQ,+BAA+B;AAExE,SAASC,QAAQ,EAAEC,WAAW,EAAEC,gBAAgB,QAAQ,8BAA8B;AACtF,SAASC,KAAK,QAAQ,gBAAgB;AAEtC,SAASC,YAAY,QAAQ,mCAAmC;AAChE,OAAOC,oBAAoB,MAAM,iEAAiE;AAClG,SAASC,4BAA4B,QAAQ,6DAA6D;AAC1G,OAAOC,uBAAuB,MAAM,0CAA0C;AAC9E,SAAuCC,sCAAsC,QAAQ,kCAAkC;AACvH,OAAOC,0BAA0B,MAAM,+EAA+E;AACtH,SAASC,iBAAiB,QAAQ,2DAA2D;AAE7F,OAAO,MAAMC,iBAAiB,CAAC;EAM7B,OAAiBC,gBAAgB,GAAiCb,wBAAwB,CAACa,gBAAgB;EAI3G,OAAiBC,UAAU,GAAG,
|
|
1
|
+
{"version":3,"names":["Platform","fetchUnitScript","UnitComponentsUiManager","warnClientIfNeeded","UNComponentsSDKConstants","setTheme","setLanguage","setCustomerToken","store","UserDataKeys","UNStoreManagerHelper","UnitComponentsHelpersManager","UNSecurityManagerHelper","UNComponentsSnapshotProtectionStrategy","UNSnapshotProtectionHelper","loadIosFontBase64","UnitComponentsSDK","securitySettings","sdkVersion","iosFontBase64Map","init","env","theme","language","fonts","webVersioningStrategy","webSDKRecommendedStrategy","ui","helpers","isJailbroke","isDeviceJailbroke","Error","OS","dispatch","shouldProtectFromSnapshot","snapshotProtectionStrategy","None","setIosSecurity","e","console","log","isInitialized","undefined","setPushProvisioningModule","pushProvisionModule","getPushProvisionModule","getSecuritySettings","setSignedNonce","signedNonce","getEnv","getWebVersioningStrategy","getFonts","getSignedNonce","customerToken","getSdkVersion","cleanUserData","cleanValue","unitCustomerToken","unitVerifiedCustomerToken","unitApplicationFormVerifiedToken"],"sourceRoot":"../../../src","sources":["unitComponentsSdkManager/UnitComponentsSdkManager.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNBottomSheetComponent.constants.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UNBottomSheetComponent.constants.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4CAA4C,MAAM,CAAC;AAIhE,eAAO,MAAM,oBAAoB,QAAiF,CAAC;AAEnH,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,gBAAgB,QAA+B,CAAC"}
|
package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNBottomSheetComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"UNBottomSheetComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx"],"names":[],"mappings":";;AAmPA,wBAAsD"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { NativeComponentData } from '../../../../types/internal/bottomSheet.types';
|
|
3
3
|
export interface UNBottomSheetNativeComponentProps {
|
|
4
4
|
nativeComponentData: NativeComponentData;
|
|
5
|
+
containerHeight: number;
|
|
5
6
|
}
|
|
6
7
|
declare const UNBottomSheetNativeComponent: (props: UNBottomSheetNativeComponentProps) => JSX.Element;
|
|
7
8
|
export default UNBottomSheetNativeComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNBottomSheetNativeComponent.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,mBAAmB,EAEpB,MAAM,8CAA8C,CAAC;AAiBtD,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"UNBottomSheetNativeComponent.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,mBAAmB,EAEpB,MAAM,8CAA8C,CAAC;AAiBtD,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,4BAA4B,UAAW,iCAAiC,gBAoI7E,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
|
|
@@ -5,6 +5,7 @@ export interface UNBottomSheetSlotComponentProps {
|
|
|
5
5
|
requestRenderingEvent: RequestRenderingEvent;
|
|
6
6
|
componentName?: WebComponentType;
|
|
7
7
|
componentResourceId?: string;
|
|
8
|
+
containerHeight: number;
|
|
8
9
|
}
|
|
9
10
|
declare const UNBottomSheetSlotComponent: (props: UNBottomSheetSlotComponentProps) => JSX.Element;
|
|
10
11
|
export default UNBottomSheetSlotComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNBottomSheetSlotComponent.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAoB,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAUnG,OAAO,EACL,qBAAqB,EAEtB,MAAM,yDAAyD,CAAC;AA2BjE,MAAM,WAAW,+BAA+B;IAC9C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"UNBottomSheetSlotComponent.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAoB,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAUnG,OAAO,EACL,qBAAqB,EAEtB,MAAM,yDAAyD,CAAC;AA2BjE,MAAM,WAAW,+BAA+B;IAC9C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,0BAA0B,UAAW,+BAA+B,gBA6LzE,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAetE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAGpF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,EAAE,OAAO,CAAC;IAClC,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,6BAA6B,EAAE,OAAO,CAAC;IACvC,WAAW,CAAC,EAAE,0BAA0B,CAAC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,QAAA,MAAM,WAAW,UAAW,gBAAgB,gBAuN3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -12,8 +12,10 @@ export declare const getStylesObject: (fadeAnim: any) => {
|
|
|
12
12
|
opacity: any;
|
|
13
13
|
};
|
|
14
14
|
container: {
|
|
15
|
-
position: "
|
|
16
|
-
|
|
15
|
+
position: "absolute";
|
|
16
|
+
bottom: number;
|
|
17
|
+
left: number;
|
|
18
|
+
right: number;
|
|
17
19
|
shadowColor: string;
|
|
18
20
|
shadowOffset: {
|
|
19
21
|
width: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.styles.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/BottomSheet/BottomSheet.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,aAAc,GAAG
|
|
1
|
+
{"version":3,"file":"BottomSheet.styles.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/BottomSheet/BottomSheet.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,aAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiE5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnitComponentsSdkManager.d.ts","sourceRoot":"","sources":["../../../../src/unitComponentsSdkManager/UnitComponentsSdkManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAGzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAE3G,OAAO,EAAE,4BAA4B,EAA0C,MAAM,kCAAkC,CAAC;AAIxH,qBAAa,iBAAiB;IAC5B,OAAc,EAAE,EAAE,uBAAuB,CAAC;IAC1C,OAAc,OAAO,EAAE,4BAA4B,CAAC;IAEpD,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,uBAAuB,CAAC;IAC/C,SAAS,CAAC,MAAM,CAAC,qBAAqB,EAAE,iCAAiC,CAAC;IAC1E,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,4BAA4B,CAA6C;IAC5G,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IACtC,SAAS,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,OAAO,aAAa,CAAC;IAC5D,SAAS,CAAC,MAAM,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"UnitComponentsSdkManager.d.ts","sourceRoot":"","sources":["../../../../src/unitComponentsSdkManager/UnitComponentsSdkManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAGzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAE3G,OAAO,EAAE,4BAA4B,EAA0C,MAAM,kCAAkC,CAAC;AAIxH,qBAAa,iBAAiB;IAC5B,OAAc,EAAE,EAAE,uBAAuB,CAAC;IAC1C,OAAc,OAAO,EAAE,4BAA4B,CAAC;IAEpD,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,uBAAuB,CAAC;IAC/C,SAAS,CAAC,MAAM,CAAC,qBAAqB,EAAE,iCAAiC,CAAC;IAC1E,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,4BAA4B,CAA6C;IAC5G,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IACtC,SAAS,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,OAAO,aAAa,CAAC;IAC5D,SAAS,CAAC,MAAM,CAAC,UAAU,SAAkB;IAC7C,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAErD,OAAc,IAAI,QACX,uBAAuB,UACpB,MAAM,aACH,MAAM,UACT,OAAO,0BACQ,iCAAiC,qBACtC,4BAA4B,mBA4B9C;IAEF,OAAc,aAAa,gBAEzB;IAEF,OAAc,yBAAyB,yBAA0B,oBAAoB,UAEnF;IAEF,OAAc,sBAAsB,+DAElC;IAEF,OAAc,mBAAmB,qCAE/B;IAEF;;OAEG;IACH,OAAc,cAAc,gBAAiB,MAAM,UAEjD;IAEF,OAAc,MAAM,4CAElB;IAEF,OAAc,wBAAwB,0CAEpC;IAEF,OAAc,QAAQ,4BAEpB;IAEF;;OAEG;IACH,OAAc,cAAc,2BAE1B;IAEF,OAAc,gBAAgB,kBAAmB,MAAM,UAErD;IAEF,OAAc,aAAa,eAEzB;IAEF,OAAc,aAAa,aAIzB;CAEH"}
|
package/package.json
CHANGED
|
@@ -1,35 +1,10 @@
|
|
|
1
|
-
import { Dimensions
|
|
2
|
-
import { initialWindowMetrics } from 'react-native-safe-area-context';
|
|
1
|
+
import { Dimensions } from 'react-native';
|
|
3
2
|
|
|
4
3
|
export const BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE = 0.9;
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const isAndroid = Platform.OS === 'android';
|
|
10
|
-
const isAndroid15AndAbove = isAndroid && Platform.Version >= 35;
|
|
11
|
-
|
|
12
|
-
// Android 15+ edge-to-edge detection
|
|
13
|
-
const isEdgeToEdgeActive = isAndroid15AndAbove && Math.abs(screenHeight - windowHeight) < 10;
|
|
14
|
-
|
|
15
|
-
// Calculate overFullScreenHeight based on platform
|
|
16
|
-
const calculateOverFullScreenHeight = (): number => {
|
|
17
|
-
if (!isAndroid) {
|
|
18
|
-
// iOS: simple percentage of window height
|
|
19
|
-
return windowHeight * BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Android: adjust for edge-to-edge status
|
|
23
|
-
const topMargin = screenHeight * (1 - BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE);
|
|
24
|
-
if (isEdgeToEdgeActive) {
|
|
25
|
-
return screenHeight - topMargin;
|
|
26
|
-
} else {
|
|
27
|
-
// Edge-to-edge opted out: status bar is outside window, adjust margin
|
|
28
|
-
return windowHeight - (topMargin - statusBarHeight);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const overFullScreenHeight = calculateOverFullScreenHeight();
|
|
5
|
+
// Fallback value for components rendered outside the measured container (e.g. UNAddToWalletComponent).
|
|
6
|
+
// The bottom sheet itself uses layout-measured containerHeight instead of this value.
|
|
7
|
+
export const overFullScreenHeight = Dimensions.get('screen').height * BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE;
|
|
33
8
|
|
|
34
9
|
export const TOP_PADDING = 48;
|
|
35
10
|
export const BOTTOM_PADDING = 24;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { View } from 'react-native';
|
|
3
|
+
import { LayoutChangeEvent, View } from 'react-native';
|
|
4
4
|
import BottomSheet from '../../helpers/BottomSheet/BottomSheet';
|
|
5
5
|
import { RequestRenderingEvent, UnitComponentsMessage } from '../../messages/webMessages/unitComponentsMessages';
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import { withReduxStore } from '../../helpers/store/helpers';
|
|
20
20
|
import { useEventListener } from '../../hooks/useEventListener';
|
|
21
21
|
import { useDispatch, useSelector } from 'react-redux';
|
|
22
|
-
import {
|
|
22
|
+
import { BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE } from './UNBottomSheetComponent.constants';
|
|
23
23
|
import { RootState } from '../../store';
|
|
24
24
|
import {
|
|
25
25
|
resetBottomSheetSlice,
|
|
@@ -34,11 +34,9 @@ import UNBottomSheetSlotComponent from './components/UNBottomSheetSlotComponent/
|
|
|
34
34
|
import UNBottomSheetNativeComponent from './components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent';
|
|
35
35
|
import { WebComponentType } from '../../types/internal/webComponent.types';
|
|
36
36
|
import { getNativeComponentDataFromEvent } from './UNBottomSheetComponent.utils';
|
|
37
|
-
import { useSafeAreaDimensions } from '../../hooks/useSafeAreaDimensions';
|
|
38
37
|
|
|
39
38
|
const UNBottomSheetComponent = () => {
|
|
40
39
|
const dispatch = useDispatch();
|
|
41
|
-
const { fullScreenHeight } = useSafeAreaDimensions();
|
|
42
40
|
|
|
43
41
|
const isBottomSheetActive = useSelector((state: RootState) => state.bottomSheet.isBottomSheetActive);
|
|
44
42
|
const isComponentLoading = useSelector((state: RootState) => state.bottomSheet.isComponentLoading);
|
|
@@ -49,55 +47,58 @@ const UNBottomSheetComponent = () => {
|
|
|
49
47
|
const shouldEnableBottomSheetScroll = useSelector((state: RootState) => state.bottomSheet.shouldEnableBottomSheetScroll);
|
|
50
48
|
const [renderingType, setRenderingType] = useState<BottomSheetRenderingType>();
|
|
51
49
|
const [height, setHeight] = useState(0);
|
|
52
|
-
const [sliderMaxHeight, setSliderMaxHeight] = useState(
|
|
50
|
+
const [sliderMaxHeight, setSliderMaxHeight] = useState(0);
|
|
51
|
+
const [containerHeight, setContainerHeight] = useState(0);
|
|
53
52
|
const [nativeComponentData, setNativeComponentData] = useState<NativeComponentData>();
|
|
54
53
|
const [requestRenderingEventData, setRequestRenderingEventData] = useState<RequestRenderingEvent>();
|
|
55
54
|
const [componentParams, setComponentParams] = useState<{
|
|
56
55
|
componentName?: WebComponentType,
|
|
57
56
|
componentResourceId?: string
|
|
58
57
|
}>();
|
|
59
|
-
|
|
58
|
+
|
|
60
59
|
const [currentBottomSheetRenderingMessage, setCurrentBottomSheetRenderingMessage] = useState<BottomSheetRenderingMessage>();
|
|
61
60
|
const styles = getStylesObject();
|
|
62
61
|
|
|
62
|
+
const handleContainerLayout = (e: LayoutChangeEvent) => {
|
|
63
|
+
setContainerHeight(e.nativeEvent.layout.height);
|
|
64
|
+
};
|
|
65
|
+
|
|
63
66
|
useEffect(() => {
|
|
64
|
-
|
|
67
|
+
if (containerHeight === 0) return;
|
|
68
|
+
|
|
69
|
+
const computedOverFullScreenHeight = containerHeight * BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE;
|
|
70
|
+
|
|
71
|
+
// Always set sliderMaxHeight when containerHeight is available,
|
|
72
|
+
// so the BottomSheet can mount and render children (which may need to load before reporting height).
|
|
73
|
+
if (nativePlace === BottomSheetNativePlaceType.modal) {
|
|
74
|
+
setSliderMaxHeight(containerHeight);
|
|
75
|
+
} else {
|
|
76
|
+
setSliderMaxHeight(computedOverFullScreenHeight);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (!shouldShowBottomSheet) {
|
|
80
|
+
setHeight(0);
|
|
81
|
+
} else {
|
|
82
|
+
// For overFullScreen/modal, set the known height immediately so the WebView
|
|
83
|
+
// has space to load (older Android WebViews won't fire events with 0 height).
|
|
84
|
+
// For menu/contentHeight, wait until content reports its height.
|
|
65
85
|
switch (nativePlace) {
|
|
66
|
-
// In the case of overFullScreen, set the height to the overFullScreenHeight.
|
|
67
86
|
case BottomSheetNativePlaceType.overFullScreen:
|
|
68
|
-
setHeight(
|
|
87
|
+
setHeight(computedOverFullScreenHeight);
|
|
69
88
|
break;
|
|
70
89
|
case BottomSheetNativePlaceType.modal:
|
|
71
|
-
setHeight(
|
|
90
|
+
setHeight(containerHeight);
|
|
72
91
|
break;
|
|
73
92
|
default:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
setHeight(
|
|
93
|
+
if (!isComponentLoading && componentHeight) {
|
|
94
|
+
setHeight(componentHeight < computedOverFullScreenHeight ? componentHeight : computedOverFullScreenHeight);
|
|
95
|
+
} else {
|
|
96
|
+
setHeight(0);
|
|
78
97
|
}
|
|
79
98
|
break;
|
|
80
99
|
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const setSliderMaxHeightFromNativePlace = () => {
|
|
84
|
-
if (nativePlace === BottomSheetNativePlaceType.modal) {
|
|
85
|
-
setSliderMaxHeight(fullScreenHeight);
|
|
86
|
-
} else {
|
|
87
|
-
setSliderMaxHeight(overFullScreenHeight);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// Check if the inner contained component is still loading or the bottom sheet should not be shown.
|
|
92
|
-
if (isComponentLoading || !shouldShowBottomSheet) {
|
|
93
|
-
// If so, hide the bottom sheet by setting the height to 0.
|
|
94
|
-
setHeight(0);
|
|
95
|
-
} else {
|
|
96
|
-
// If not, display the bottom sheet by calculating and setting the height based on the native place type.
|
|
97
|
-
setHeightFromNativePlace();
|
|
98
|
-
setSliderMaxHeightFromNativePlace();
|
|
99
100
|
}
|
|
100
|
-
}, [componentHeight, nativePlace, isComponentLoading, shouldShowBottomSheet]);
|
|
101
|
+
}, [componentHeight, nativePlace, isComponentLoading, shouldShowBottomSheet, containerHeight]);
|
|
101
102
|
|
|
102
103
|
useEffect(() => {
|
|
103
104
|
const resetBottomSheetManagerState = () => {
|
|
@@ -106,7 +107,7 @@ const UNBottomSheetComponent = () => {
|
|
|
106
107
|
setNativeComponentData(undefined);
|
|
107
108
|
setRenderingType(undefined);
|
|
108
109
|
setHeight(0);
|
|
109
|
-
setSliderMaxHeight(
|
|
110
|
+
setSliderMaxHeight(0);
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
if (!isBottomSheetActive) {
|
|
@@ -198,6 +199,7 @@ const UNBottomSheetComponent = () => {
|
|
|
198
199
|
requestRenderingEvent={requestRenderingEventData}
|
|
199
200
|
componentName={componentParams?.componentName}
|
|
200
201
|
componentResourceId={componentParams?.componentResourceId}
|
|
202
|
+
containerHeight={containerHeight}
|
|
201
203
|
/>
|
|
202
204
|
) : null;
|
|
203
205
|
|
|
@@ -205,6 +207,7 @@ const UNBottomSheetComponent = () => {
|
|
|
205
207
|
return nativeComponentData ? (
|
|
206
208
|
<UNBottomSheetNativeComponent
|
|
207
209
|
nativeComponentData={nativeComponentData}
|
|
210
|
+
containerHeight={containerHeight}
|
|
208
211
|
/>
|
|
209
212
|
) : null;
|
|
210
213
|
|
|
@@ -212,26 +215,28 @@ const UNBottomSheetComponent = () => {
|
|
|
212
215
|
return null;
|
|
213
216
|
}
|
|
214
217
|
};
|
|
218
|
+
|
|
219
|
+
if (!isBottomSheetActive) return null;
|
|
220
|
+
|
|
215
221
|
return (
|
|
216
|
-
<View
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
</BottomSheet>
|
|
222
|
+
<View style={styles.container} onLayout={handleContainerLayout}>
|
|
223
|
+
{containerHeight > 0 && sliderMaxHeight > 0 && (
|
|
224
|
+
<BottomSheet
|
|
225
|
+
isOpen={isBottomSheetActive}
|
|
226
|
+
onOpen={() => dispatch(setIsBottomSheetActive(true))}
|
|
227
|
+
onClose={() => dispatch(setIsBottomSheetActive(false))}
|
|
228
|
+
height={height}
|
|
229
|
+
animationDuration={200}
|
|
230
|
+
expandToMaxHeightEnabled={false}
|
|
231
|
+
handleWebViewScroll={() => handleWebViewScroll()}
|
|
232
|
+
shouldEnableBottomSheetScroll={shouldEnableBottomSheetScroll}
|
|
233
|
+
nativePlace={nativePlace}
|
|
234
|
+
isComponentLoading={isComponentLoading}
|
|
235
|
+
sliderMaxHeight={sliderMaxHeight}
|
|
236
|
+
>
|
|
237
|
+
{renderBottomSheetComponent()}
|
|
238
|
+
</BottomSheet>
|
|
239
|
+
)}
|
|
235
240
|
</View>
|
|
236
241
|
);
|
|
237
242
|
};
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { useDispatch } from 'react-redux';
|
|
8
8
|
import { setComponentHeight, setScrollState, setShouldEnableBottomSheetScroll } from '../../../../slices/BottomSheetSlice';
|
|
9
9
|
import { UNAddToWalletComponent } from '../../../../nativeComponents/UNAddToWallet/UNAddToWalletComponent';
|
|
10
|
-
import {
|
|
10
|
+
import { BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE } from '../../UNBottomSheetComponent.constants';
|
|
11
11
|
import { useSafeAreaDimensions } from '../../../../hooks/useSafeAreaDimensions';
|
|
12
12
|
import UNACHCreditComponent from '../../../UNACHCreditComponent/UNACHCreditComponent';
|
|
13
13
|
import UNCheckDepositComponent from '../../../UNCheckDepositComponent/UNCheckDepositComponent';
|
|
@@ -22,11 +22,14 @@ import UNKeyboardAvoidingView from '../../../../helpers/UNKeyboardAvoidingView/U
|
|
|
22
22
|
|
|
23
23
|
export interface UNBottomSheetNativeComponentProps {
|
|
24
24
|
nativeComponentData: NativeComponentData;
|
|
25
|
+
containerHeight: number;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
const UNBottomSheetNativeComponent = (props: UNBottomSheetNativeComponentProps) => {
|
|
28
29
|
const dispatch = useDispatch();
|
|
29
|
-
const {
|
|
30
|
+
const { insets, effectiveBottomInset } = useSafeAreaDimensions();
|
|
31
|
+
const overFullScreenHeight = props.containerHeight * BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE;
|
|
32
|
+
const modalContentHeight = props.containerHeight - insets.top;
|
|
30
33
|
const [height, setHeight] = useState<number>(0);
|
|
31
34
|
const [paddingTop, setPaddingTop] = useState<number>(0);
|
|
32
35
|
const [paddingBottom, setPaddingBottom] = useState<number>(0);
|
|
@@ -67,7 +70,7 @@ const UNBottomSheetNativeComponent = (props: UNBottomSheetNativeComponentProps)
|
|
|
67
70
|
adjustedHeight = overFullScreenHeight;
|
|
68
71
|
break;
|
|
69
72
|
case BottomSheetNativePlaceType.modal:
|
|
70
|
-
adjustedHeight =
|
|
73
|
+
adjustedHeight = modalContentHeight;
|
|
71
74
|
break;
|
|
72
75
|
default:
|
|
73
76
|
return;
|
|
@@ -79,7 +82,7 @@ const UNBottomSheetNativeComponent = (props: UNBottomSheetNativeComponentProps)
|
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
setBottomSheetNativeComponentViewHeight();
|
|
82
|
-
}, [props.nativeComponentData.nativePlace,
|
|
85
|
+
}, [props.nativeComponentData.nativePlace, modalContentHeight, overFullScreenHeight, dispatch]);
|
|
83
86
|
|
|
84
87
|
const renderNativeComponent = () => {
|
|
85
88
|
switch (props.nativeComponentData?.component.type) {
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
} from '../../../../slices/BottomSheetSlice';
|
|
31
31
|
import { getAccountActionType } from '../../../UNAccountComponent/UNAccountComponent.utils';
|
|
32
32
|
import { UNAccountAction } from '../../../UNAccountComponent/UNAccountComponent';
|
|
33
|
-
import { BOTTOM_PADDING,
|
|
33
|
+
import { BOTTOM_PADDING, BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE, LEFT_PADDING, RIGHT_PADDING, TOP_PADDING, VERTICAL_PADDING } from '../../UNBottomSheetComponent.constants';
|
|
34
34
|
import { useSafeAreaDimensions } from '../../../../hooks/useSafeAreaDimensions';
|
|
35
35
|
import { BottomSheetNativeMessage } from '../../../../messages/nativeMessages/bottomSheetMessage';
|
|
36
36
|
import { OpenPlaidEvent, PlaidMessage } from '../../../../messages/webMessages/plaidMessages';
|
|
@@ -43,6 +43,7 @@ export interface UNBottomSheetSlotComponentProps {
|
|
|
43
43
|
requestRenderingEvent: RequestRenderingEvent;
|
|
44
44
|
componentName?: WebComponentType,
|
|
45
45
|
componentResourceId?: string,
|
|
46
|
+
containerHeight: number,
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
@@ -50,7 +51,9 @@ const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
|
50
51
|
const webRef = useRef<WebView>(null);
|
|
51
52
|
const scrollState = useSelector((state: RootState) => state.bottomSheet.scrollState);
|
|
52
53
|
const nativePlace = props.requestRenderingEvent?.data?.nativePlace;
|
|
53
|
-
const {
|
|
54
|
+
const { insets, effectiveBottomInset } = useSafeAreaDimensions();
|
|
55
|
+
const overFullScreenHeight = props.containerHeight * BOTTOM_SHEET_OVER_FULLSCREEN_PERCENTAGE_SIZE;
|
|
56
|
+
const modalContentHeight = props.containerHeight - insets.top;
|
|
54
57
|
|
|
55
58
|
useEffect(() => {
|
|
56
59
|
const scrollStateForSlot = () => {
|
|
@@ -113,8 +116,8 @@ const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
|
113
116
|
}
|
|
114
117
|
case BottomSheetNativePlaceType.modal: {
|
|
115
118
|
const injectedHeight = !props.requestRenderingEvent.data.isPaddingIncluded
|
|
116
|
-
?
|
|
117
|
-
:
|
|
119
|
+
? modalContentHeight - VERTICAL_PADDING - effectiveBottomInset
|
|
120
|
+
: modalContentHeight - effectiveBottomInset;
|
|
118
121
|
injectHtmlFullScreenHeight(webRef.current, injectedHeight);
|
|
119
122
|
break;
|
|
120
123
|
}
|
|
@@ -219,7 +222,7 @@ const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
|
219
222
|
|
|
220
223
|
return (
|
|
221
224
|
<View style={{...paddingStyle, flex: 1}}>
|
|
222
|
-
<UNKeyboardAvoidingView keyboardVerticalOffset={
|
|
225
|
+
<UNKeyboardAvoidingView keyboardVerticalOffset={props.containerHeight - overFullScreenHeight}>
|
|
223
226
|
<WebComponent
|
|
224
227
|
ref={webRef}
|
|
225
228
|
type={WebComponentType.slot}
|
|
@@ -18,8 +18,10 @@ export const getStylesObject = (fadeAnim: any) => {
|
|
|
18
18
|
opacity: fadeAnim,
|
|
19
19
|
},
|
|
20
20
|
container: {
|
|
21
|
-
position: '
|
|
22
|
-
|
|
21
|
+
position: 'absolute',
|
|
22
|
+
bottom: 0,
|
|
23
|
+
left: 0,
|
|
24
|
+
right: 0,
|
|
23
25
|
shadowColor: VARIABLES.COLORS.BLACK,
|
|
24
26
|
shadowOffset: {
|
|
25
27
|
width: 0,
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
Image,
|
|
7
7
|
LayoutChangeEvent,
|
|
8
8
|
PanResponder,
|
|
9
|
-
Platform,
|
|
10
9
|
TouchableOpacity,
|
|
11
10
|
View,
|
|
12
11
|
} from 'react-native';
|
|
@@ -37,11 +36,11 @@ const BottomSheet = (props: BottomSheetProps) => {
|
|
|
37
36
|
const panelHeightValue = useRef(new Animated.Value(props.sliderMaxHeight)).current;
|
|
38
37
|
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
39
38
|
const styles = getStylesObject(fadeAnim);
|
|
40
|
-
|
|
39
|
+
// Initialize to false: BottomSheet mounts fresh each time (conditionally rendered),
|
|
40
|
+
// so useEffect will trigger fadeIn() when isOpen=true on mount.
|
|
41
|
+
const [isPanelOpened, setIsPanelOpened] = useState(false);
|
|
41
42
|
const [contentHeight, setContentHeight] = useState<number | undefined>(undefined);
|
|
42
|
-
const { insets
|
|
43
|
-
// Android 15+ (API 35) enforces edge-to-edge, so marginTop calculation differs
|
|
44
|
-
const isAndroid15AndAbove = Platform.OS === 'android' && Platform.Version >= 35;
|
|
43
|
+
const { insets } = useSafeAreaDimensions();
|
|
45
44
|
|
|
46
45
|
const [currentHeight, setCurrentHeight] = useState<number>(props.sliderMaxHeight);
|
|
47
46
|
|
|
@@ -161,10 +160,25 @@ const BottomSheet = (props: BottomSheetProps) => {
|
|
|
161
160
|
return isPanelOpened;
|
|
162
161
|
};
|
|
163
162
|
|
|
163
|
+
// Track the last height we animated to, so we skip duplicate animations
|
|
164
|
+
// (prevents visual jitter when _setSize fires multiple times with the same height)
|
|
165
|
+
// but still re-animate when the height actually changes.
|
|
166
|
+
const lastAnimatedHeight = useRef(0);
|
|
167
|
+
|
|
168
|
+
// Reset when new content starts loading, so the next opening can animate.
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
if (props.isComponentLoading) {
|
|
171
|
+
lastAnimatedHeight.current = 0;
|
|
172
|
+
}
|
|
173
|
+
}, [props.isComponentLoading]);
|
|
174
|
+
|
|
164
175
|
const _setSize = (e: LayoutChangeEvent) => {
|
|
165
176
|
const newContentHeight = e.nativeEvent.layout.height;
|
|
166
177
|
setContentHeight(newContentHeight);
|
|
167
|
-
|
|
178
|
+
if (newContentHeight > 0 && newContentHeight !== lastAnimatedHeight.current) {
|
|
179
|
+
lastAnimatedHeight.current = newContentHeight;
|
|
180
|
+
setToContentHeight(newContentHeight);
|
|
181
|
+
}
|
|
168
182
|
};
|
|
169
183
|
|
|
170
184
|
const _dismiss = (withAnimation = true) => {
|
|
@@ -203,13 +217,10 @@ const BottomSheet = (props: BottomSheetProps) => {
|
|
|
203
217
|
borderTopLeftRadius: isModal ? 0 : styles.container.borderTopLeftRadius,
|
|
204
218
|
borderTopRightRadius: isModal ? 0 : styles.container.borderTopRightRadius,
|
|
205
219
|
height: props.sliderMaxHeight,
|
|
206
|
-
// Android 15+ (edge-to-edge): fullScreenHeight is already the full screen, no adjustment needed
|
|
207
|
-
// Android 10-14: fullScreenHeight includes status bar, but view starts below it, so subtract insets.top
|
|
208
|
-
marginTop: isModal ? 0 : fullScreenHeight - props.sliderMaxHeight - (isAndroid10AndAbove && !isAndroid15AndAbove ? insets.top : 0),
|
|
209
220
|
transform: [
|
|
210
221
|
{ translateY: panelHeightValue },
|
|
211
222
|
],
|
|
212
|
-
paddingTop: isModal
|
|
223
|
+
paddingTop: isModal ? insets.top : 0,
|
|
213
224
|
}}
|
|
214
225
|
>
|
|
215
226
|
<View
|
|
@@ -26,7 +26,7 @@ export class UnitComponentsSDK {
|
|
|
26
26
|
protected static fonts?: UNFonts;
|
|
27
27
|
protected static signedNonce?: string;
|
|
28
28
|
protected static pushProvisionModule?: typeof NativeModules;
|
|
29
|
-
protected static sdkVersion = '3.1.1';
|
|
29
|
+
protected static sdkVersion = '3.1.2-beta.1';
|
|
30
30
|
static iosFontBase64Map: Record<string, string> = {};
|
|
31
31
|
|
|
32
32
|
public static init = async (
|