react-native-unit-components 0.1.0 → 1.0.0
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 +157 -2
- package/lib/commonjs/assets/images/close.png +0 -0
- package/lib/commonjs/assets/images/index.js +16 -0
- package/lib/commonjs/assets/images/index.js.map +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +28 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +20 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +39 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +40 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +9 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -0
- package/lib/commonjs/components/{BottomSheet/BottomSheetComponent.js → UNBottomSheetComponent/UNBottomSheetComponent.js} +84 -65
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js +23 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +49 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -0
- package/lib/commonjs/components/{Card/CardComponent.js → UNCardComponent/UNCardComponent.js} +42 -46
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -0
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +42 -0
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -0
- package/lib/commonjs/components/index.js +34 -8
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/custom.d.js +2 -0
- package/lib/commonjs/custom.d.js.map +1 -0
- package/lib/commonjs/helpers/{BottomSheet.js → BottomSheet/BottomSheet.js} +36 -82
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -0
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js +82 -0
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js.map +1 -0
- package/lib/commonjs/helpers/EventBus.js +5 -13
- package/lib/commonjs/helpers/EventBus.js.map +1 -1
- package/lib/commonjs/hooks/listenerToBus.js +31 -0
- package/lib/commonjs/hooks/listenerToBus.js.map +1 -0
- package/lib/commonjs/hooks/useAppStateListener.js +34 -0
- package/lib/commonjs/hooks/useAppStateListener.js.map +1 -0
- package/lib/commonjs/index.js +33 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/index.js +13 -0
- package/lib/commonjs/messages/nativeMessages/index.js.map +1 -0
- package/lib/commonjs/messages/webMessages/bookPaymentMessage.js +13 -0
- package/lib/commonjs/messages/webMessages/bookPaymentMessage.js.map +1 -0
- package/lib/commonjs/{webComponent → messages}/webMessages/cardMessage.js +1 -1
- package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/index.js +6 -0
- package/lib/commonjs/messages/webMessages/index.js.map +1 -0
- package/lib/commonjs/{webComponent → messages}/webMessages/pageMessage.js +0 -0
- package/lib/commonjs/{webComponent → messages}/webMessages/pageMessage.js.map +0 -0
- package/lib/commonjs/{webComponent → messages}/webMessages/unitMessages.js +0 -0
- package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -0
- package/lib/commonjs/nativeComponenet/NativeComponentExample.js +2 -2
- package/lib/commonjs/nativeComponenet/NativeComponentExample.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyHtml.js +52 -0
- package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -0
- package/lib/commonjs/scripts/html/bodyScript.js +78 -0
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -0
- package/lib/commonjs/sharedTypes/bookPayment.types.js +6 -0
- package/lib/commonjs/sharedTypes/bookPayment.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/card.types.js +6 -0
- package/lib/commonjs/sharedTypes/card.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/index.js +32 -0
- package/lib/commonjs/sharedTypes/index.js.map +1 -0
- package/lib/commonjs/sharedTypes/types.js +2 -0
- package/lib/commonjs/sharedTypes/types.js.map +1 -0
- package/lib/commonjs/styles/variables.js +17 -0
- package/lib/commonjs/styles/variables.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js +54 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +51 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -0
- package/lib/commonjs/webComponent/WebComponent.js +35 -15
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +22 -45
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/assets/images/close.png +0 -0
- package/lib/module/assets/images/index.js +2 -0
- package/lib/module/assets/images/index.js.map +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +13 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +10 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +23 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +26 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +131 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js +13 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +29 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.js +65 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +24 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -0
- package/lib/module/components/index.js +4 -2
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/custom.d.js +2 -0
- package/lib/module/custom.d.js.map +1 -0
- package/lib/module/helpers/{BottomSheet.js → BottomSheet/BottomSheet.js} +34 -81
- package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -0
- package/lib/module/helpers/BottomSheet/BottomSheet.styles.js +70 -0
- package/lib/module/helpers/BottomSheet/BottomSheet.styles.js.map +1 -0
- package/lib/module/helpers/EventBus.js +4 -11
- package/lib/module/helpers/EventBus.js.map +1 -1
- package/lib/module/hooks/listenerToBus.js +18 -0
- package/lib/module/hooks/listenerToBus.js.map +1 -0
- package/lib/module/hooks/useAppStateListener.js +23 -0
- package/lib/module/hooks/useAppStateListener.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/messages/nativeMessages/index.js +6 -0
- package/lib/module/messages/nativeMessages/index.js.map +1 -0
- package/lib/module/messages/webMessages/bookPaymentMessage.js +6 -0
- package/lib/module/messages/webMessages/bookPaymentMessage.js.map +1 -0
- package/lib/module/messages/webMessages/cardMessage.js +6 -0
- package/lib/module/messages/webMessages/cardMessage.js.map +1 -0
- package/lib/module/messages/webMessages/index.js +2 -0
- package/lib/module/messages/webMessages/index.js.map +1 -0
- package/lib/module/{webComponent → messages}/webMessages/pageMessage.js +0 -0
- package/lib/module/{webComponent → messages}/webMessages/pageMessage.js.map +0 -0
- package/lib/module/{webComponent → messages}/webMessages/unitMessages.js +0 -0
- package/lib/module/messages/webMessages/unitMessages.js.map +1 -0
- package/lib/module/nativeComponenet/NativeComponentExample.js +2 -2
- package/lib/module/nativeComponenet/NativeComponentExample.js.map +1 -1
- package/lib/module/scripts/html/bodyHtml.js +42 -0
- package/lib/module/scripts/html/bodyHtml.js.map +1 -0
- package/lib/module/scripts/html/bodyScript.js +64 -0
- package/lib/module/scripts/html/bodyScript.js.map +1 -0
- package/lib/module/sharedTypes/bookPayment.types.js +2 -0
- package/lib/module/sharedTypes/bookPayment.types.js.map +1 -0
- package/lib/module/sharedTypes/card.types.js +2 -0
- package/lib/module/sharedTypes/card.types.js.map +1 -0
- package/lib/module/sharedTypes/index.js +3 -0
- package/lib/module/sharedTypes/index.js.map +1 -0
- package/lib/module/sharedTypes/types.js +2 -0
- package/lib/module/sharedTypes/types.js.map +1 -0
- package/lib/module/styles/variables.js +10 -0
- package/lib/module/styles/variables.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdk.api.js +37 -0
- package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js +38 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -0
- package/lib/module/webComponent/WebComponent.js +34 -14
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/html.js +18 -44
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/assets/images/index.d.ts +1 -0
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +6 -0
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.utils.d.ts +2 -0
- package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +11 -0
- package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.d.ts +3 -0
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts +1 -0
- package/lib/typescript/components/{BottomSheet/BottomSheetComponent.d.ts → UNBottomSheetComponent/UNBottomSheetComponent.d.ts} +0 -0
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.d.ts +9 -0
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +5 -0
- package/lib/typescript/components/{Card/CardComponent.d.ts → UNCardComponent/UNCardComponent.d.ts} +3 -1
- package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +6 -0
- package/lib/typescript/components/index.d.ts +4 -2
- package/lib/typescript/helpers/{BottomSheet.d.ts → BottomSheet/BottomSheet.d.ts} +1 -0
- package/lib/typescript/helpers/BottomSheet/BottomSheet.styles.d.ts +63 -0
- package/lib/typescript/helpers/EventBus.d.ts +5 -7
- package/lib/typescript/hooks/listenerToBus.d.ts +7 -0
- package/lib/typescript/hooks/useAppStateListener.d.ts +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/messages/nativeMessages/index.d.ts +3 -0
- package/lib/typescript/messages/webMessages/bookPaymentMessage.d.ts +8 -0
- package/lib/typescript/{webComponent → messages}/webMessages/cardMessage.d.ts +3 -2
- package/lib/typescript/messages/webMessages/index.d.ts +11 -0
- package/lib/typescript/{webComponent → messages}/webMessages/pageMessage.d.ts +0 -0
- package/lib/typescript/{webComponent → messages}/webMessages/unitMessages.d.ts +0 -0
- package/lib/typescript/scripts/html/bodyHtml.d.ts +7 -0
- package/lib/typescript/scripts/html/bodyScript.d.ts +11 -0
- package/lib/typescript/sharedTypes/bookPayment.types.d.ts +26 -0
- package/lib/typescript/sharedTypes/card.types.d.ts +56 -0
- package/lib/typescript/sharedTypes/index.d.ts +2 -0
- package/lib/typescript/sharedTypes/types.d.ts +27 -0
- package/lib/typescript/styles/variables.d.ts +9 -0
- package/lib/typescript/unitSdkManager/UnitSdk.api.d.ts +3 -0
- package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +15 -0
- package/lib/typescript/webComponent/WebComponent.d.ts +8 -11
- package/lib/typescript/webComponent/html.d.ts +6 -1
- package/package.json +9 -5
- package/{unit-react-native-components.podspec → react-native-unit-components.podspec} +1 -1
- package/src/assets/images/close.png +0 -0
- package/src/assets/images/index.ts +1 -0
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +21 -0
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +11 -0
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +37 -0
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.ts +29 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.ts +1 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.ts +13 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +136 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +34 -0
- package/src/components/UNCardComponent/UNCardComponent.tsx +73 -0
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +28 -0
- package/src/components/index.ts +4 -2
- package/src/custom.d.ts +5 -0
- package/src/helpers/BottomSheet/BottomSheet.styles.ts +70 -0
- package/src/helpers/{BottomSheet.tsx → BottomSheet/BottomSheet.tsx} +72 -110
- package/src/helpers/EventBus.ts +13 -13
- package/src/hooks/listenerToBus.ts +23 -0
- package/src/hooks/useAppStateListener.ts +25 -0
- package/src/index.tsx +5 -1
- package/src/messages/nativeMessages/index.ts +3 -0
- package/src/messages/webMessages/bookPaymentMessage.ts +12 -0
- package/src/{webComponent → messages}/webMessages/cardMessage.ts +4 -2
- package/src/messages/webMessages/index.ts +21 -0
- package/src/{webComponent → messages}/webMessages/pageMessage.ts +0 -0
- package/src/{webComponent → messages}/webMessages/unitMessages.ts +1 -0
- package/src/nativeComponenet/NativeComponentExample.tsx +2 -2
- package/src/scripts/html/bodyHtml.ts +46 -0
- package/src/scripts/html/bodyScript.ts +67 -0
- package/src/sharedTypes/bookPayment.types.ts +27 -0
- package/src/sharedTypes/card.types.ts +59 -0
- package/src/sharedTypes/index.ts +2 -0
- package/src/sharedTypes/types.ts +35 -0
- package/src/styles/variables.ts +9 -0
- package/src/unitSdkManager/UnitSdk.api.ts +31 -0
- package/src/unitSdkManager/UnitSdkManager.ts +33 -0
- package/src/webComponent/WebComponent.tsx +43 -45
- package/src/webComponent/html.ts +22 -46
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js.map +0 -1
- package/lib/commonjs/components/Card/CardComponent.js.map +0 -1
- package/lib/commonjs/helpers/BottomSheet.js.map +0 -1
- package/lib/commonjs/webComponent/webMessages/cardMessage.js.map +0 -1
- package/lib/commonjs/webComponent/webMessages/unitMessages.js.map +0 -1
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +0 -118
- package/lib/module/components/BottomSheet/BottomSheetComponent.js.map +0 -1
- package/lib/module/components/Card/CardComponent.js +0 -75
- package/lib/module/components/Card/CardComponent.js.map +0 -1
- package/lib/module/helpers/BottomSheet.js.map +0 -1
- package/lib/module/webComponent/webMessages/cardMessage.js +0 -6
- package/lib/module/webComponent/webMessages/cardMessage.js.map +0 -1
- package/lib/module/webComponent/webMessages/unitMessages.js.map +0 -1
- package/src/components/BottomSheet/BottomSheetComponent.tsx +0 -113
- package/src/components/Card/CardComponent.tsx +0 -75
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UnitMessage","BOTTOM_SHEET_MAX_PRECANTAGE_SIZE","getBottomSheetScript","UNIT_REQUEST_REFRESH","renderingBottomSheetRequest","currentWebView","renderingRequest","injectJavaScript","resetHtml","handleHtmlFullHeight","windowHeight","bottomSheetHeight"],"sources":["UNBottomSheetComponent.utils.ts"],"sourcesContent":["import type WebView from 'react-native-webview';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\nimport { BOTTOM_SHEET_MAX_PRECANTAGE_SIZE } from './UNBottomSheetComponent.constants';\n\nexport const getBottomSheetScript = () => {\n return `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_REFRESH}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_REFRESH}\", details: e.detail })\n });\n `;\n};\n\nexport const renderingBottomSheetRequest = (currentWebView: WebView, renderingRequest: string) => {\n currentWebView?.injectJavaScript(`\n document.activeElement && document.activeElement.blur();\n dispatchRenderingEvent('${renderingRequest}');\n `);\n};\n\nexport const resetHtml = (currentWebView: WebView) => {\n currentWebView?.injectJavaScript(`\n document.activeElement && document.activeElement.blur();\n document.getElementById('webViewContainer').style.height = null;\n `);\n};\n\nexport const handleHtmlFullHeight = (currentWebView: WebView | null, windowHeight: number) => {\n const bottomSheetHeight = windowHeight * BOTTOM_SHEET_MAX_PRECANTAGE_SIZE;\n currentWebView && currentWebView?.injectJavaScript(`\n document.getElementById('webViewContainer').style.height = '${bottomSheetHeight}px';\n `);\n\n return bottomSheetHeight;\n};\n"],"mappings":"AACA,SAASA,WAAT,QAA4B,yCAA5B;AACA,SAASC,gCAAT,QAAiD,oCAAjD;AAEA,OAAO,MAAMC,oBAAoB,GAAG,MAAM;EACxC,OAAQ;AACV,+BAA+BF,WAAW,CAACG,oBAAqB;AAChE,kCAAkCH,WAAW,CAACG,oBAAqB;AACnE;AACA,GAJE;AAKD,CANM;AAQP,OAAO,MAAMC,2BAA2B,GAAG,CAACC,cAAD,EAA0BC,gBAA1B,KAAuD;EAChGD,cAAc,SAAd,IAAAA,cAAc,WAAd,YAAAA,cAAc,CAAEE,gBAAhB,CAAkC;AACpC;AACA,8BAA8BD,gBAAiB;AAC/C,GAHE;AAID,CALM;AAOP,OAAO,MAAME,SAAS,GAAIH,cAAD,IAA6B;EACpDA,cAAc,SAAd,IAAAA,cAAc,WAAd,YAAAA,cAAc,CAAEE,gBAAhB,CAAkC;AACpC;AACA;AACA,GAHE;AAID,CALM;AAOP,OAAO,MAAME,oBAAoB,GAAG,CAACJ,cAAD,EAAiCK,YAAjC,KAA0D;EAC5F,MAAMC,iBAAiB,GAAGD,YAAY,GAAGT,gCAAzC;EACAI,cAAc,KAAIA,cAAJ,aAAIA,cAAJ,uBAAIA,cAAc,CAAEE,gBAAhB,CAAkC;AACtD,kEAAkEI,iBAAkB;AACpF,GAFoB,CAAJ,CAAd;EAIA,OAAOA,iBAAP;AACD,CAPM"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Dimensions, View } from 'react-native';
|
|
3
|
+
import { PageMessage } from '../../messages/webMessages/pageMessage';
|
|
4
|
+
import { UnitMessage } from '../../messages/webMessages/unitMessages';
|
|
5
|
+
import EventBus from '../../helpers/EventBus';
|
|
6
|
+
import { WebComponent, WebComponentType } from '../../webComponent/WebComponent';
|
|
7
|
+
import { useListenerToBus } from '../../hooks/listenerToBus';
|
|
8
|
+
import { getCardParams, getCardScript, injectRefreshEventIfNeeded } from './UNCardComponent.utils';
|
|
9
|
+
import { PresentationMode } from '../../scripts/html/bodyHtml';
|
|
10
|
+
import { CardMessage } from '../../messages/webMessages/cardMessage';
|
|
11
|
+
export const UNCardComponent = props => {
|
|
12
|
+
const [height, setHeight] = useState(0);
|
|
13
|
+
const [requestRefreshEvent, setRequestRefreshEvent] = useState(null);
|
|
14
|
+
const windowWidth = Dimensions.get('window').width;
|
|
15
|
+
const webRef = useRef(null);
|
|
16
|
+
|
|
17
|
+
const cardStatusChanged = card => {
|
|
18
|
+
if (props.onStatusChanged) {
|
|
19
|
+
props.onStatusChanged(card);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const requestRefresh = data => {
|
|
24
|
+
setRequestRefreshEvent(data);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
useListenerToBus([{
|
|
28
|
+
busEventKey: CardMessage.CARD_STATUS_CHANGED,
|
|
29
|
+
action: cardStatusChanged
|
|
30
|
+
}, {
|
|
31
|
+
busEventKey: UnitMessage.UNIT_REQUEST_REFRESH,
|
|
32
|
+
action: requestRefresh
|
|
33
|
+
}]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
injectRefreshEventIfNeeded(webRef.current, requestRefreshEvent, props.cardId);
|
|
36
|
+
}, [requestRefreshEvent]);
|
|
37
|
+
|
|
38
|
+
const handleMessage = message => {
|
|
39
|
+
switch (message.type) {
|
|
40
|
+
case UnitMessage.UNIT_REQUEST_RENDERING:
|
|
41
|
+
EventBus.Instance.event(UnitMessage.UNIT_REQUEST_RENDERING, message.details.data);
|
|
42
|
+
break;
|
|
43
|
+
|
|
44
|
+
case PageMessage.PAGE_HEIGHT:
|
|
45
|
+
setHeight(message.details.height);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
51
|
+
style: {
|
|
52
|
+
height
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement(WebComponent, {
|
|
55
|
+
ref: webRef,
|
|
56
|
+
type: WebComponentType.card,
|
|
57
|
+
presentationMode: PresentationMode.Default,
|
|
58
|
+
params: getCardParams(props),
|
|
59
|
+
script: getCardScript(),
|
|
60
|
+
onMessage: message => handleMessage(message),
|
|
61
|
+
width: windowWidth,
|
|
62
|
+
shouldEnableWebViewScroll: false
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=UNCardComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","Dimensions","View","PageMessage","UnitMessage","EventBus","WebComponent","WebComponentType","useListenerToBus","getCardParams","getCardScript","injectRefreshEventIfNeeded","PresentationMode","CardMessage","UNCardComponent","props","height","setHeight","requestRefreshEvent","setRequestRefreshEvent","windowWidth","get","width","webRef","cardStatusChanged","card","onStatusChanged","requestRefresh","data","busEventKey","CARD_STATUS_CHANGED","action","UNIT_REQUEST_REFRESH","current","cardId","handleMessage","message","type","UNIT_REQUEST_RENDERING","Instance","event","details","PAGE_HEIGHT","Default"],"sources":["UNCardComponent.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type WebView from 'react-native-webview';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport EventBus from '../../helpers/EventBus';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport { useListenerToBus } from '../../hooks/listenerToBus';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { getCardParams, getCardScript, injectRefreshEventIfNeeded } from './UNCardComponent.utils';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport type { UNCardData } from '../../sharedTypes';\nimport { CardMessage } from '../../messages/webMessages/cardMessage';\n\nexport interface UNCardComponentProps {\n cardId: string;\n customerToken: string;\n theme?: string;\n onStatusChanged?: (card: UNCardData) => void;\n}\n\nexport const UNCardComponent = (props: UNCardComponentProps) => {\n const [height, setHeight] = useState(0);\n const [requestRefreshEvent, setRequestRefreshEvent] = useState<RequestRefreshEvent | null>(null);\n const windowWidth = Dimensions.get('window').width;\n\n const webRef = useRef<WebView>(null);\n\n const cardStatusChanged = (card: UNCardData) => {\n if (props.onStatusChanged) {\n props.onStatusChanged(card);\n }\n };\n\n const requestRefresh = (data: RequestRefreshEvent) => {\n setRequestRefreshEvent(data);\n };\n\n useListenerToBus([\n { busEventKey: CardMessage.CARD_STATUS_CHANGED, action: cardStatusChanged },\n { busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh },\n ]);\n\n useEffect(() => {\n injectRefreshEventIfNeeded(webRef.current, requestRefreshEvent, props.cardId);\n }, [requestRefreshEvent]);\n\n const handleMessage = (message: WebViewMessage) => {\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_RENDERING:\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_RENDERING, (message.details as RequestRenderingEvent).data);\n break;\n case PageMessage.PAGE_HEIGHT:\n setHeight((message.details as HeightEvent).height);\n break;\n }\n };\n\n return (\n <View style={{ height }}>\n <WebComponent\n ref={webRef}\n type={WebComponentType.card}\n presentationMode={PresentationMode.Default}\n params={getCardParams(props)}\n script={getCardScript()}\n onMessage={message => handleMessage(message)}\n width={windowWidth}\n shouldEnableWebViewScroll={false}\n />\n </View>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,MAA3B,EAAmCC,QAAnC,QAAmD,OAAnD;AACA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,cAAjC;AAEA,SAAsBC,WAAtB,QAAyC,wCAAzC;AACA,SAAqDC,WAArD,QAAwE,yCAAxE;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,SAASC,YAAT,EAAuBC,gBAAvB,QAA+C,iCAA/C;AACA,SAASC,gBAAT,QAAiC,2BAAjC;AAEA,SAASC,aAAT,EAAwBC,aAAxB,EAAuCC,0BAAvC,QAAyE,yBAAzE;AACA,SAASC,gBAAT,QAAiC,6BAAjC;AAEA,SAASC,WAAT,QAA4B,wCAA5B;AASA,OAAO,MAAMC,eAAe,GAAIC,KAAD,IAAiC;EAC9D,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsBjB,QAAQ,CAAC,CAAD,CAApC;EACA,MAAM,CAACkB,mBAAD,EAAsBC,sBAAtB,IAAgDnB,QAAQ,CAA6B,IAA7B,CAA9D;EACA,MAAMoB,WAAW,GAAGnB,UAAU,CAACoB,GAAX,CAAe,QAAf,EAAyBC,KAA7C;EAEA,MAAMC,MAAM,GAAGxB,MAAM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;IAME,SAAS,EAAE0B,OAAO,IAAID,aAAa,CAACC,OAAD,CANrC;IAOE,KAAK,EAAEhB,WAPT;IAQE,yBAAyB,EAAE;EAR7B,EADF,CADF;AAcD,CAnDM"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { WebComponentType } from '../../webComponent/WebComponent';
|
|
2
|
+
import { UnitMessage } from '../../messages/webMessages/unitMessages';
|
|
3
|
+
import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
|
|
4
|
+
export const getCardParams = props => {
|
|
5
|
+
return `
|
|
6
|
+
card-id="${props.cardId}"
|
|
7
|
+
customer-token="${props.customerToken}"
|
|
8
|
+
theme="${props.theme ?? UnitSDK.getTheme()}"
|
|
9
|
+
`;
|
|
10
|
+
};
|
|
11
|
+
export const getCardScript = () => {
|
|
12
|
+
return `
|
|
13
|
+
const dispatchRefreshEvent = (details) => {
|
|
14
|
+
const event = new CustomEvent("${UnitMessage.UNIT_REQUEST_REFRESH}",{ detail: JSON.parse(details) })
|
|
15
|
+
window.dispatchEvent(event)
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
};
|
|
19
|
+
export const injectRefreshEventIfNeeded = (currentWeb, requestRefreshEvent, cardId) => {
|
|
20
|
+
if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == cardId) {
|
|
21
|
+
currentWeb === null || currentWeb === void 0 ? void 0 : currentWeb.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=UNCardComponent.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebComponentType","UnitMessage","UnitSDK","getCardParams","props","cardId","customerToken","theme","getTheme","getCardScript","UNIT_REQUEST_REFRESH","injectRefreshEventIfNeeded","currentWeb","requestRefreshEvent","dependencies","includes","card","valueOf","resourceId","injectJavaScript","JSON","stringify"],"sources":["UNCardComponent.utils.ts"],"sourcesContent":["import type WebView from 'react-native-webview';\nimport type { UNCardComponentProps } from './UNCardComponent';\nimport { WebComponentType } from '../../webComponent/WebComponent';\nimport { RequestRefreshEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport { UnitSDK } from '../../unitSdkManager/UnitSdkManager';\n\nexport const getCardParams = (props: UNCardComponentProps) => {\n return `\n card-id=\"${props.cardId}\"\n customer-token=\"${props.customerToken}\"\n theme=\"${props.theme ?? UnitSDK.getTheme()}\"\n `;\n};\n\nexport const getCardScript = () => {\n return `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_REFRESH}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n `;\n};\n\nexport const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => {\n if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == cardId) {\n currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);\n }\n};\n"],"mappings":"AAEA,SAASA,gBAAT,QAAiC,iCAAjC;AACA,SAA8BC,WAA9B,QAAiD,yCAAjD;AACA,SAASC,OAAT,QAAwB,qCAAxB;AAEA,OAAO,MAAMC,aAAa,GAAIC,KAAD,IAAiC;EAC5D,OAAQ;AACV,eAAeA,KAAK,CAACC,MAAO;AAC5B,sBAAsBD,KAAK,CAACE,aAAc;AAC1C,aAAaF,KAAK,CAACG,KAAN,IAAeL,OAAO,CAACM,QAAR,EAAmB;AAC/C,GAJE;AAKD,CANM;AAQP,OAAO,MAAMC,aAAa,GAAG,MAAM;EACjC,OAAQ;AACV;AACA,qCAAqCR,WAAW,CAACS,oBAAqB;AACtE;AACA;AACA,GALE;AAMD,CAPM;AASP,OAAO,MAAMC,0BAA0B,GAAG,CAACC,UAAD,EAA6BC,mBAA7B,EAA8ER,MAA9E,KAAiG;EACzI,IAAIQ,mBAAmB,IAAIA,mBAAmB,CAACC,YAApB,CAAiCC,QAAjC,CAA0Cf,gBAAgB,CAACgB,IAAjB,CAAsBC,OAAtB,EAA1C,CAAvB,IAAqGJ,mBAAmB,CAACK,UAApB,IAAkCb,MAA3I,EAAmJ;IACjJO,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAEO,gBAAZ,CAA8B,yBAAwBC,IAAI,CAACC,SAAL,CAAeR,mBAAf,CAAoC,IAA1F;EACD;AACF,CAJM"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './UNCardComponent/UNCardComponent';
|
|
2
|
+
export * from './UNBottomSheetComponent/UNBottomSheetComponent';
|
|
3
|
+
export * from './UNBookPaymentComponent/UNBookPaymentComponent';
|
|
4
|
+
export * from './UNActivityComponent/UNActivityComponent';
|
|
3
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './UNCardComponent/UNCardComponent';\nexport * from './UNBottomSheetComponent/UNBottomSheetComponent';\nexport * from './UNBookPaymentComponent/UNBookPaymentComponent';\nexport * from './UNActivityComponent/UNActivityComponent';\n"],"mappings":"AAAA,cAAc,mCAAd;AACA,cAAc,iDAAd;AACA,cAAc,iDAAd;AACA,cAAc,2CAAd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["custom.d.ts"],"sourcesContent":["declare module '*.png' {\n import { ImageSourcePropType } from 'react-native';\n const content: ImageSourcePropType;\n export default content;\n}\n"],"mappings":""}
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { Animated, BackHandler, Dimensions, Easing,
|
|
4
|
+
import { Animated, BackHandler, Dimensions, Easing, Image, KeyboardAvoidingView, PanResponder, TouchableOpacity, View } from 'react-native';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import { CloseIcon } from '../../assets/images';
|
|
7
|
+
import { BOTTOM_SHEET_MAX_PRECANTAGE_SIZE } from '../../components/UNBottomSheetComponent/UNBottomSheetComponent.constants';
|
|
8
|
+
import { getStylesObject } from './BottomSheet.styles';
|
|
6
9
|
|
|
7
10
|
const BottomSheet = props => {
|
|
8
11
|
const panelHeightValue = useRef(new Animated.Value(props.sliderMaxHeight)).current;
|
|
9
12
|
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
13
|
+
const styles = getStylesObject(fadeAnim);
|
|
10
14
|
const [isPanelOpened, setIsPanelOpened] = useState(props.isOpen);
|
|
11
15
|
const [contentHeight, setContentHeight] = useState(undefined);
|
|
12
16
|
const [currentHeight, setCurrentHeight] = useState(props.sliderMaxHeight);
|
|
13
17
|
const [dy, setDy] = useState(0);
|
|
14
18
|
|
|
15
19
|
const _parentPanResponder = PanResponder.create({
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21
|
+
onMoveShouldSetPanResponderCapture: _ => {
|
|
22
|
+
//gestureState) => {
|
|
23
|
+
return false; // return Math.abs(gestureState.dy) > 10
|
|
18
24
|
},
|
|
19
25
|
|
|
20
26
|
onPanResponderMove(_, gestureState) {
|
|
21
27
|
if (currentHeight + gestureState.dy < 0) return;
|
|
22
|
-
if (!props.expandToMaxHeightEnabled && currentHeight + gestureState.dy < sliderMaxHeight - contentHeight) return;
|
|
28
|
+
if (!props.expandToMaxHeightEnabled && contentHeight && currentHeight + gestureState.dy < sliderMaxHeight - contentHeight) return;
|
|
23
29
|
panelHeightValue.setValue(currentHeight + gestureState.dy);
|
|
24
30
|
setDy(gestureState.dy);
|
|
25
31
|
},
|
|
@@ -28,7 +34,7 @@ const BottomSheet = props => {
|
|
|
28
34
|
if (dy > 0) {
|
|
29
35
|
collapse();
|
|
30
36
|
} else if (!props.expandToMaxHeightEnabled) {
|
|
31
|
-
setToContentHeight(contentHeight);
|
|
37
|
+
contentHeight && setToContentHeight(contentHeight);
|
|
32
38
|
} else if (dy < 0) {
|
|
33
39
|
expand();
|
|
34
40
|
} else {
|
|
@@ -90,7 +96,7 @@ const BottomSheet = props => {
|
|
|
90
96
|
animationDuration
|
|
91
97
|
} = props;
|
|
92
98
|
|
|
93
|
-
if (currentHeight > sliderMaxHeight - contentHeight) {
|
|
99
|
+
if (contentHeight && currentHeight > sliderMaxHeight - contentHeight) {
|
|
94
100
|
setToContentHeight(contentHeight);
|
|
95
101
|
return;
|
|
96
102
|
}
|
|
@@ -104,27 +110,13 @@ const BottomSheet = props => {
|
|
|
104
110
|
};
|
|
105
111
|
|
|
106
112
|
const collapse = () => {
|
|
107
|
-
if (currentHeight > sliderMaxHeight - contentHeight) {
|
|
113
|
+
if (contentHeight && currentHeight > sliderMaxHeight - contentHeight) {
|
|
108
114
|
_dismiss();
|
|
109
115
|
|
|
110
116
|
return;
|
|
111
117
|
}
|
|
112
118
|
|
|
113
|
-
setToContentHeight(contentHeight);
|
|
114
|
-
// duration: animationDuration,
|
|
115
|
-
// easing: Easing.quad,
|
|
116
|
-
// toValue: sliderMaxHeight - contentHeight!,
|
|
117
|
-
// useNativeDriver: false,
|
|
118
|
-
// }).start(() => {
|
|
119
|
-
// const isPanelOpenedNewValue = !isPanelOpened
|
|
120
|
-
// setIsPanelOpened(isPanelOpenedNewValue)
|
|
121
|
-
// if (isPanelOpenedNewValue) {
|
|
122
|
-
// // onOpen();
|
|
123
|
-
// } else {
|
|
124
|
-
// // onClose();
|
|
125
|
-
// Keyboard.dismiss();
|
|
126
|
-
// }
|
|
127
|
-
// });
|
|
119
|
+
contentHeight && setToContentHeight(contentHeight);
|
|
128
120
|
};
|
|
129
121
|
|
|
130
122
|
const _onBackPress = () => {
|
|
@@ -133,8 +125,7 @@ const BottomSheet = props => {
|
|
|
133
125
|
};
|
|
134
126
|
|
|
135
127
|
const _setSize = e => {
|
|
136
|
-
|
|
137
|
-
if (newContentHeight !== 0) newContentHeight += 42;
|
|
128
|
+
const newContentHeight = e.nativeEvent.layout.height;
|
|
138
129
|
setContentHeight(newContentHeight);
|
|
139
130
|
setToContentHeight(newContentHeight);
|
|
140
131
|
};
|
|
@@ -148,7 +139,9 @@ const BottomSheet = props => {
|
|
|
148
139
|
easing: Easing.quad,
|
|
149
140
|
toValue: sliderMaxHeight,
|
|
150
141
|
useNativeDriver: false
|
|
151
|
-
}).start(() => {
|
|
142
|
+
}).start(() => {
|
|
143
|
+
null;
|
|
144
|
+
});
|
|
152
145
|
fadeOut();
|
|
153
146
|
};
|
|
154
147
|
|
|
@@ -157,21 +150,11 @@ const BottomSheet = props => {
|
|
|
157
150
|
children
|
|
158
151
|
} = props;
|
|
159
152
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
160
|
-
style:
|
|
161
|
-
position: 'absolute',
|
|
162
|
-
top: 0,
|
|
163
|
-
bottom: 0,
|
|
164
|
-
right: 0,
|
|
165
|
-
left: 0
|
|
166
|
-
},
|
|
153
|
+
style: styles.outsideContainer,
|
|
167
154
|
activeOpacity: 1,
|
|
168
155
|
onPress: _dismiss
|
|
169
156
|
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
170
|
-
style:
|
|
171
|
-
backgroundColor: 'black',
|
|
172
|
-
flex: 1,
|
|
173
|
-
opacity: fadeAnim
|
|
174
|
-
}
|
|
157
|
+
style: styles.animation
|
|
175
158
|
})), /*#__PURE__*/React.createElement(Animated.View, _extends({}, _parentPanResponder.panHandlers, {
|
|
176
159
|
style: { ...styles.container,
|
|
177
160
|
height: sliderMaxHeight,
|
|
@@ -182,15 +165,21 @@ const BottomSheet = props => {
|
|
|
182
165
|
}), /*#__PURE__*/React.createElement(View, {
|
|
183
166
|
style: styles.outerContent
|
|
184
167
|
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
185
|
-
activeOpacity: 1
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}, /*#__PURE__*/React.createElement(
|
|
189
|
-
|
|
190
|
-
}))
|
|
168
|
+
activeOpacity: 1,
|
|
169
|
+
style: styles.closeButton,
|
|
170
|
+
onPress: _dismiss
|
|
171
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
172
|
+
source: CloseIcon
|
|
173
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
191
174
|
onLayout: _setSize,
|
|
192
175
|
style: [styles.innerContent]
|
|
193
|
-
},
|
|
176
|
+
}, /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
177
|
+
behavior: "padding",
|
|
178
|
+
style: {
|
|
179
|
+
height: props.height
|
|
180
|
+
},
|
|
181
|
+
keyboardVerticalOffset: props.height * (1 - BOTTOM_SHEET_MAX_PRECANTAGE_SIZE)
|
|
182
|
+
}, children)))));
|
|
194
183
|
};
|
|
195
184
|
|
|
196
185
|
BottomSheet.propTypes = {
|
|
@@ -206,47 +195,11 @@ BottomSheet.propTypes = {
|
|
|
206
195
|
BottomSheet.defaultProps = {
|
|
207
196
|
children: /*#__PURE__*/React.createElement(View, null),
|
|
208
197
|
isOpen: true,
|
|
209
|
-
sliderMaxHeight: Dimensions.get('window').height *
|
|
198
|
+
sliderMaxHeight: Dimensions.get('window').height * BOTTOM_SHEET_MAX_PRECANTAGE_SIZE,
|
|
210
199
|
animationDuration: 200,
|
|
211
200
|
onOpen: () => null,
|
|
212
201
|
onClose: () => null,
|
|
213
202
|
expandToMaxHeightEnabled: false
|
|
214
203
|
};
|
|
215
|
-
const styles = StyleSheet.create({
|
|
216
|
-
container: {
|
|
217
|
-
flex: 1,
|
|
218
|
-
marginTop: 60,
|
|
219
|
-
paddingHorizontal: 12,
|
|
220
|
-
shadowColor: '#000000',
|
|
221
|
-
shadowOffset: {
|
|
222
|
-
width: 0,
|
|
223
|
-
height: 6
|
|
224
|
-
},
|
|
225
|
-
shadowOpacity: 0.37,
|
|
226
|
-
shadowRadius: 7.49,
|
|
227
|
-
elevation: 12,
|
|
228
|
-
borderTopLeftRadius: 15,
|
|
229
|
-
borderTopRightRadius: 15,
|
|
230
|
-
backgroundColor: '#ffffff'
|
|
231
|
-
},
|
|
232
|
-
lineContainer: {
|
|
233
|
-
borderTopLeftRadius: 30,
|
|
234
|
-
borderTopRightRadius: 30,
|
|
235
|
-
alignItems: 'center'
|
|
236
|
-
},
|
|
237
|
-
line: {
|
|
238
|
-
width: 35,
|
|
239
|
-
height: 4,
|
|
240
|
-
borderRadius: 2,
|
|
241
|
-
marginTop: 18,
|
|
242
|
-
backgroundColor: '#D5DDE0'
|
|
243
|
-
},
|
|
244
|
-
outerContent: {
|
|
245
|
-
flex: -1
|
|
246
|
-
},
|
|
247
|
-
innerContent: {
|
|
248
|
-
flex: -1
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
204
|
export default BottomSheet;
|
|
252
205
|
//# sourceMappingURL=BottomSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","Animated","BackHandler","Dimensions","Easing","Image","KeyboardAvoidingView","PanResponder","TouchableOpacity","View","PropTypes","CloseIcon","BOTTOM_SHEET_MAX_PRECANTAGE_SIZE","getStylesObject","BottomSheet","props","panelHeightValue","Value","sliderMaxHeight","current","fadeAnim","styles","isPanelOpened","setIsPanelOpened","isOpen","contentHeight","setContentHeight","undefined","currentHeight","setCurrentHeight","dy","setDy","_parentPanResponder","create","onMoveShouldSetPanResponderCapture","_","onPanResponderMove","gestureState","expandToMaxHeightEnabled","setValue","onPanResponderRelease","collapse","setToContentHeight","expand","fadeIn","_dismiss","addEventListener","_onBackPress","id","addListener","e","value","removeEventListener","removeListener","timing","toValue","duration","useNativeDriver","start","fadeOut","onClose","animationDuration","easing","quad","_setSize","newContentHeight","nativeEvent","layout","height","children","outsideContainer","animation","panHandlers","container","transform","translateY","outerContent","closeButton","innerContent","propTypes","oneOfType","node","bool","number","func","onOpen","defaultProps","get"],"sources":["BottomSheet.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useRef, useState } from 'react';\nimport {\n Animated,\n BackHandler,\n Dimensions,\n Easing,\n Image,\n KeyboardAvoidingView,\n LayoutChangeEvent,\n PanResponder,\n TouchableOpacity,\n View,\n} from 'react-native';\nimport PropTypes from 'prop-types';\nimport { CloseIcon } from '../../assets/images';\nimport { BOTTOM_SHEET_MAX_PRECANTAGE_SIZE } from '../../components/UNBottomSheetComponent/UNBottomSheetComponent.constants';\nimport { getStylesObject } from './BottomSheet.styles';\n\nexport interface BottomSheetProps {\n isOpen: boolean\n children: ReactNode\n sliderMaxHeight: number\n onOpen: () => void\n onClose: () => void\n height: number,\n animationDuration: number,\n expandToMaxHeightEnabled: boolean\n}\n\nconst BottomSheet = (props: BottomSheetProps) => {\n const panelHeightValue = useRef(new Animated.Value(props.sliderMaxHeight)).current;\n const fadeAnim = useRef(new Animated.Value(0)).current;\n const styles = getStylesObject(fadeAnim);\n const [isPanelOpened, setIsPanelOpened] = useState(props.isOpen);\n const [contentHeight, setContentHeight] = useState<number | undefined>(undefined);\n\n const [currentHeight, setCurrentHeight] = useState<number>(props.sliderMaxHeight);\n\n const [dy, setDy] = useState(0);\n\n const _parentPanResponder = PanResponder.create({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onMoveShouldSetPanResponderCapture: (_,) => { //gestureState) => {\n return false;\n // return Math.abs(gestureState.dy) > 10\n },\n onPanResponderMove(_, gestureState) {\n if (currentHeight + gestureState.dy < 0) return;\n if (!props.expandToMaxHeightEnabled && contentHeight && currentHeight + gestureState.dy < sliderMaxHeight - contentHeight) return;\n panelHeightValue.setValue(currentHeight + gestureState.dy);\n setDy(gestureState.dy);\n },\n onPanResponderRelease: () => {\n if (dy > 0) {\n collapse();\n } else if (!props.expandToMaxHeightEnabled) {\n contentHeight && setToContentHeight(contentHeight);\n } else if (dy < 0) {\n expand();\n } else {\n expand();\n }\n }\n });\n\n useEffect(() => {\n if (props.isOpen && !isPanelOpened) {\n fadeIn();\n } else if (isPanelOpened) {\n setContentHeight(0);\n _dismiss();\n }\n }, [props.isOpen]);\n\n useEffect(() => {\n BackHandler.addEventListener('hardwareBackPress', _onBackPress);\n const id = panelHeightValue.addListener(e => setCurrentHeight(e.value));\n\n return (() => {\n BackHandler.removeEventListener('hardwareBackPress', _onBackPress);\n panelHeightValue.removeListener(id);\n });\n }, []);\n\n const fadeIn = () => {\n Animated.timing(fadeAnim, {\n toValue: 0.3,\n duration: 500,\n useNativeDriver: false\n }).start(() => { setIsPanelOpened(true); });\n };\n\n const fadeOut = () => {\n Animated.timing(fadeAnim, {\n toValue: 0,\n duration: 500,\n useNativeDriver: false\n }).start(() => {\n setIsPanelOpened(false);\n props.onClose();\n });\n };\n\n const setToContentHeight = (contentHeight: number) => {\n Animated.timing(panelHeightValue, {\n duration: props.animationDuration,\n easing: Easing.quad,\n toValue: sliderMaxHeight - contentHeight,\n useNativeDriver: false,\n }).start();\n };\n\n const expand = () => {\n const { animationDuration } = props;\n\n if (contentHeight && currentHeight > (sliderMaxHeight - contentHeight)) {\n setToContentHeight(contentHeight);\n return;\n }\n\n Animated.timing(panelHeightValue, {\n duration: animationDuration,\n easing: Easing.quad,\n toValue: 0,\n useNativeDriver: false,\n }).start();\n };\n\n const collapse = () => {\n if (contentHeight && currentHeight > (sliderMaxHeight - contentHeight)) {\n _dismiss();\n return;\n }\n\n contentHeight && setToContentHeight(contentHeight);\n };\n\n const _onBackPress = () => {\n isPanelOpened && collapse();\n return isPanelOpened;\n };\n\n const _setSize = (e: LayoutChangeEvent) => {\n const newContentHeight = e.nativeEvent.layout.height;\n\n setContentHeight(newContentHeight);\n setToContentHeight(newContentHeight);\n };\n\n const _dismiss = () => {\n const { animationDuration } = props;\n Animated.timing(panelHeightValue, {\n duration: animationDuration,\n easing: Easing.quad,\n toValue: sliderMaxHeight,\n useNativeDriver: false,\n }).start(() => {\n null;\n });\n fadeOut();\n };\n\n const {\n sliderMaxHeight,\n children,\n } = props;\n\n return (\n <>\n <TouchableOpacity\n style={styles.outsideContainer} activeOpacity={1}\n onPress={_dismiss}\n >\n <Animated.View\n style={styles.animation}\n >\n </Animated.View>\n </TouchableOpacity>\n <Animated.View\n {..._parentPanResponder.panHandlers}\n style={{\n ...styles.container,\n height: sliderMaxHeight,\n transform: [\n { translateY: panelHeightValue },\n ],\n }}\n >\n <View\n style={styles.outerContent}\n >\n <TouchableOpacity\n activeOpacity={1}\n style={styles.closeButton}\n onPress={_dismiss}\n >\n <Image source={CloseIcon} />\n </TouchableOpacity>\n\n <View\n onLayout={_setSize}\n style={[styles.innerContent]}\n >\n <KeyboardAvoidingView\n behavior=\"padding\"\n style={{ height: props.height }}\n keyboardVerticalOffset={props.height * (1 - BOTTOM_SHEET_MAX_PRECANTAGE_SIZE)}\n >\n {children}\n </KeyboardAvoidingView>\n </View>\n </View>\n </Animated.View>\n </>\n );\n};\n\nBottomSheet.propTypes = {\n children: PropTypes.oneOfType([PropTypes.node]),\n isOpen: PropTypes.bool,\n sliderMaxHeight: PropTypes.number,\n animation: PropTypes.func,\n animationDuration: PropTypes.number,\n onOpen: PropTypes.func,\n onClose: PropTypes.func,\n expandToMaxHeightEnabled: PropTypes.bool\n};\n\nBottomSheet.defaultProps = {\n children: <View />,\n isOpen: true,\n sliderMaxHeight: Dimensions.get('window').height * BOTTOM_SHEET_MAX_PRECANTAGE_SIZE,\n animationDuration: 200,\n onOpen: () => null,\n onClose: () => null,\n expandToMaxHeightEnabled: false\n};\n\nexport default BottomSheet;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAA2BC,SAA3B,E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AE,GAJM;EAKzBwB,MAAM,EAAE,MAAM,IALW;EAMzBzB,OAAO,EAAE,MAAM,IANU;EAOzBtB,wBAAwB,EAAE;AAPD,CAA3B;AAUA,eAAexB,WAAf"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Dimensions, StyleSheet } from 'react-native';
|
|
2
|
+
import { BOTTOM_SHEET_MAX_PRECANTAGE_SIZE } from '../../components/UNBottomSheetComponent/UNBottomSheetComponent.constants';
|
|
3
|
+
import { VARIABLES } from '../../styles/variables'; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
|
|
5
|
+
export const getStylesObject = fadeAnim => {
|
|
6
|
+
return StyleSheet.create({
|
|
7
|
+
outsideContainer: {
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
top: 0,
|
|
10
|
+
bottom: 0,
|
|
11
|
+
right: 0,
|
|
12
|
+
left: 0
|
|
13
|
+
},
|
|
14
|
+
animation: {
|
|
15
|
+
backgroundColor: 'black',
|
|
16
|
+
flex: 1,
|
|
17
|
+
opacity: fadeAnim
|
|
18
|
+
},
|
|
19
|
+
container: {
|
|
20
|
+
position: 'relative',
|
|
21
|
+
flex: 1,
|
|
22
|
+
marginTop: Dimensions.get('window').height * (1 - BOTTOM_SHEET_MAX_PRECANTAGE_SIZE),
|
|
23
|
+
shadowColor: VARIABLES.COLORS.BLACK,
|
|
24
|
+
shadowOffset: {
|
|
25
|
+
width: 0,
|
|
26
|
+
height: 6
|
|
27
|
+
},
|
|
28
|
+
shadowOpacity: 0.37,
|
|
29
|
+
shadowRadius: 7.49,
|
|
30
|
+
elevation: 12,
|
|
31
|
+
borderTopLeftRadius: 15,
|
|
32
|
+
borderTopRightRadius: 15,
|
|
33
|
+
backgroundColor: VARIABLES.COLORS.WHITE,
|
|
34
|
+
overflow: 'hidden'
|
|
35
|
+
},
|
|
36
|
+
lineContainer: {
|
|
37
|
+
borderTopLeftRadius: 30,
|
|
38
|
+
borderTopRightRadius: 30,
|
|
39
|
+
alignItems: 'center'
|
|
40
|
+
},
|
|
41
|
+
line: {
|
|
42
|
+
width: 35,
|
|
43
|
+
height: 4,
|
|
44
|
+
borderRadius: 2,
|
|
45
|
+
marginTop: 18,
|
|
46
|
+
backgroundColor: VARIABLES.COLORS.SILVER_FLAKE
|
|
47
|
+
},
|
|
48
|
+
outerContent: {
|
|
49
|
+
flex: -1
|
|
50
|
+
},
|
|
51
|
+
innerContent: {
|
|
52
|
+
flex: -1
|
|
53
|
+
},
|
|
54
|
+
closeButton: {
|
|
55
|
+
position: 'absolute',
|
|
56
|
+
display: 'flex',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
justifyContent: 'center',
|
|
59
|
+
width: 36,
|
|
60
|
+
height: 36,
|
|
61
|
+
backgroundColor: VARIABLES.COLORS.WHITE,
|
|
62
|
+
borderRadius: 18,
|
|
63
|
+
padding: 7,
|
|
64
|
+
top: 12,
|
|
65
|
+
right: 12,
|
|
66
|
+
zIndex: 100
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=BottomSheet.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Dimensions","StyleSheet","BOTTOM_SHEET_MAX_PRECANTAGE_SIZE","VARIABLES","getStylesObject","fadeAnim","create","outsideContainer","position","top","bottom","right","left","animation","backgroundColor","flex","opacity","container","marginTop","get","height","shadowColor","COLORS","BLACK","shadowOffset","width","shadowOpacity","shadowRadius","elevation","borderTopLeftRadius","borderTopRightRadius","WHITE","overflow","lineContainer","alignItems","line","borderRadius","SILVER_FLAKE","outerContent","innerContent","closeButton","display","justifyContent","padding","zIndex"],"sources":["BottomSheet.styles.ts"],"sourcesContent":["import { Dimensions, StyleSheet } from 'react-native';\nimport { BOTTOM_SHEET_MAX_PRECANTAGE_SIZE } from '../../components/UNBottomSheetComponent/UNBottomSheetComponent.constants';\nimport { VARIABLES } from '../../styles/variables';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getStylesObject = (fadeAnim: any) => {\n return StyleSheet.create({\n outsideContainer: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n right: 0,\n left: 0\n },\n animation: {\n backgroundColor: 'black',\n flex: 1,\n opacity: fadeAnim,\n },\n container: {\n position: 'relative',\n flex: 1,\n marginTop: Dimensions.get('window').height * (1 - BOTTOM_SHEET_MAX_PRECANTAGE_SIZE),\n shadowColor: VARIABLES.COLORS.BLACK,\n shadowOffset: {\n width: 0,\n height: 6,\n },\n shadowOpacity: 0.37,\n shadowRadius: 7.49,\n elevation: 12,\n borderTopLeftRadius: 15,\n borderTopRightRadius: 15,\n backgroundColor: VARIABLES.COLORS.WHITE,\n overflow: 'hidden'\n },\n lineContainer: {\n borderTopLeftRadius: 30,\n borderTopRightRadius: 30,\n alignItems: 'center'\n },\n line: {\n width: 35,\n height: 4,\n borderRadius: 2,\n marginTop: 18,\n backgroundColor: VARIABLES.COLORS.SILVER_FLAKE,\n },\n outerContent: {\n flex: -1,\n },\n innerContent: {\n flex: -1,\n },\n closeButton: {\n position: 'absolute',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 36,\n height: 36,\n backgroundColor: VARIABLES.COLORS.WHITE,\n borderRadius: 18,\n padding: 7,\n top: 12,\n right: 12,\n zIndex: 100\n }\n });\n};\n"],"mappings":"AAAA,SAASA,UAAT,EAAqBC,UAArB,QAAuC,cAAvC;AACA,SAASC,gCAAT,QAAiD,0EAAjD;AACA,SAASC,SAAT,QAA0B,wBAA1B,C,CAEA;;AACA,OAAO,MAAMC,eAAe,GAAIC,QAAD,IAAmB;EAChD,OAAOJ,UAAU,CAACK,MAAX,CAAkB;IACvBC,gBAAgB,EAAE;MAChBC,QAAQ,EAAE,UADM;MAEhBC,GAAG,EAAE,CAFW;MAGhBC,MAAM,EAAE,CAHQ;MAIhBC,KAAK,EAAE,CAJS;MAKhBC,IAAI,EAAE;IALU,CADK;IAQvBC,SAAS,EAAE;MACTC,eAAe,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AAY,EAAE,EARH;MASXO,OAAO,EAAE,CATE;MAUXlC,GAAG,EAAE,EAVM;MAWXE,KAAK,EAAE,EAXI;MAYXiC,MAAM,EAAE;IAZG;EAhDU,CAAlB,CAAP;AA+DD,CAhEM"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(function (BusEvent) {
|
|
6
|
-
BusEvent["REQUEST_RENDERING"] = "unitRequestRendering";
|
|
7
|
-
BusEvent["CARD_STATUS_CHANGED"] = "cardStatusChanged";
|
|
8
|
-
BusEvent["REQUEST_REFRESH"] = "requestRefresh";
|
|
9
|
-
})(BusEvent || (BusEvent = {}));
|
|
10
|
-
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11
4
|
export default class EventBus {
|
|
12
5
|
constructor() {
|
|
13
6
|
_defineProperty(this, "eventListeners", {});
|
|
@@ -20,7 +13,7 @@ export default class EventBus {
|
|
|
20
13
|
}
|
|
21
14
|
|
|
22
15
|
event(event, data) {
|
|
23
|
-
|
|
16
|
+
const listeners = this.eventListeners[event.valueOf()];
|
|
24
17
|
|
|
25
18
|
if (Array.isArray(listeners)) {
|
|
26
19
|
listeners.map(listener => {
|
|
@@ -32,7 +25,7 @@ export default class EventBus {
|
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
addListener(event, listener) {
|
|
35
|
-
|
|
28
|
+
const listeners = this.eventListeners[event.valueOf()];
|
|
36
29
|
|
|
37
30
|
if (Array.isArray(listeners)) {
|
|
38
31
|
listeners.push(listener);
|
|
@@ -43,7 +36,7 @@ export default class EventBus {
|
|
|
43
36
|
|
|
44
37
|
removeListener(listener) {
|
|
45
38
|
Object.keys(this.eventListeners).map(eventName => {
|
|
46
|
-
|
|
39
|
+
const listeners = this.eventListeners[eventName];
|
|
47
40
|
|
|
48
41
|
if (listeners) {
|
|
49
42
|
this._remove(listeners, listener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["EventBus","constructor","eventListeners","Instance","_instance","event","data","listeners","valueOf","Array","isArray","map","listener","addListener","push","removeListener","Object","keys","eventName","_remove","length","array","item","i","l","splice"],"sources":["EventBus.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { NativeMessage } from '../messages/nativeMessages';\nimport type { WebViewMessageType } from '../messages/webMessages';\n\nexport type BusEventKey = NativeMessage | WebViewMessageType\n\nexport default class EventBus {\n private static _instance: EventBus;\n\n private eventListeners: { [name: string]: Array<(data: any) => void> } = {};\n\n private constructor() {\n this.eventListeners = {};\n }\n\n public static get Instance() {\n return this._instance || (this._instance = new this());\n }\n\n public event(event: BusEventKey, data: any) {\n const listeners = this.eventListeners[event.valueOf()];\n if (Array.isArray(listeners)) {\n listeners.map(listener => {\n if (typeof listener === 'function') {\n listener(data);\n }\n });\n }\n }\n\n public addListener(event: BusEventKey, listener: (data: any) => void) {\n const listeners = this.eventListeners[event.valueOf()];\n if (Array.isArray(listeners)) {\n listeners.push(listener);\n } else {\n this.eventListeners[event.valueOf()] = [listener];\n }\n }\n\n public removeListener(listener: (data: any) => void) {\n Object.keys(this.eventListeners).map(eventName => {\n const listeners = this.eventListeners[eventName];\n if (listeners) {\n this._remove(listeners, listener);\n if (listeners.length === 0) {\n delete this.eventListeners[eventName];\n }\n }\n });\n }\n\n private _remove(array: Array<(data: any) => void>, item: (data: string) => void) {\n if (!array) return;\n for (let i = 0, l = array.length; i < l; i++) {\n if (item === array[i]) array.splice(i, 1);\n }\n }\n}\n"],"mappings":";;AAAA;AAMA,eAAe,MAAMA,QAAN,CAAe;EAKpBC,WAAW,GAAG;IAAA,wCAFmD,EAEnD;;IACpB,KAAKC,cAAL,GAAsB,EAAtB;EACD;;EAEyB,WAARC,QAAQ,GAA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AAC,GAAG,CAAR,EAAWC,CAAC,GAAGH,KAAK,CAACD,MAA1B,EAAkCG,CAAC,GAAGC,CAAtC,EAAyCD,CAAC,EAA1C,EAA8C;MAC5C,IAAID,IAAI,KAAKD,KAAK,CAACE,CAAD,CAAlB,EAAuBF,KAAK,CAACI,MAAN,CAAaF,CAAb,EAAgB,CAAhB;IACxB;EACF;;AAlD2B;;gBAATvB,Q"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import EventBus from '../helpers/EventBus';
|
|
4
|
+
export const useListenerToBus = listeners => {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
{
|
|
7
|
+
listeners.map(listener => {
|
|
8
|
+
EventBus.Instance.addListener(listener.busEventKey, listener.action);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return () => {
|
|
12
|
+
listeners.map(listener => {
|
|
13
|
+
EventBus.Instance.removeListener(listener.action);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
}, []);
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=listenerToBus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","EventBus","useListenerToBus","listeners","map","listener","Instance","addListener","busEventKey","action","removeListener"],"sources":["listenerToBus.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useEffect } from 'react';\nimport EventBus, { BusEventKey } from '../helpers/EventBus';\n\ntype Listener = {\n busEventKey: BusEventKey,\n action: (data: any) => void\n}\n\nexport const useListenerToBus = (listeners: Listener[]) => {\n useEffect(() => {\n {\n listeners.map((listener: {busEventKey: BusEventKey, action: (data: any) => void}) => {\n EventBus.Instance.addListener(listener.busEventKey, listener.action);\n });\n }\n return (() => {\n listeners.map((listener: {busEventKey: BusEventKey, action: (data: any) => void}) => {\n EventBus.Instance.removeListener(listener.action);\n });\n });\n }, []);\n};\n"],"mappings":"AAAA;AACA,SAASA,SAAT,QAA0B,OAA1B;AACA,OAAOC,QAAP,MAAsC,qBAAtC;AAOA,OAAO,MAAMC,gBAAgB,GAAIC,SAAD,IAA2B;EACzDH,SAAS,CAAC,MAAM;IACd;MACEG,SAAS,CAACC,GAAV,CAAeC,QAAD,IAAuE;QACnFJ,QAAQ,CAACK,QAAT,CAAkBC,WAAlB,CAA8BF,QAAQ,CAACG,WAAvC,EAAoDH,QAAQ,CAACI,MAA7D;MACD,CAFD;IAGD;IACD,OAAQ,MAAM;MACZN,SAAS,CAACC,GAAV,CAAeC,QAAD,IAAuE;QACnFJ,QAAQ,CAACK,QAAT,CAAkBI,cAAlB,CAAiCL,QAAQ,CAACI,MAA1C;MACD,CAFD;IAGD,CAJD;EAKD,CAXQ,EAWN,EAXM,CAAT;AAYD,CAbM"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { AppState } from 'react-native';
|
|
4
|
+
|
|
5
|
+
const getIsAppActive = currentAppState => {
|
|
6
|
+
return currentAppState !== 'background' && currentAppState !== 'inactive';
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const useAppStateListener = () => {
|
|
10
|
+
const appState = useRef(AppState.currentState);
|
|
11
|
+
const [isAppActive, setIsAppActive] = useState(getIsAppActive(appState.current));
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const subscription = AppState.addEventListener('change', nextAppState => {
|
|
14
|
+
appState.current = nextAppState;
|
|
15
|
+
setIsAppActive(getIsAppActive(appState.current));
|
|
16
|
+
});
|
|
17
|
+
return () => {
|
|
18
|
+
subscription.remove();
|
|
19
|
+
};
|
|
20
|
+
}, []);
|
|
21
|
+
return isAppActive;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useAppStateListener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","AppState","getIsAppActive","currentAppState","useAppStateListener","appState","currentState","isAppActive","setIsAppActive","current","subscription","addEventListener","nextAppState","remove"],"sources":["useAppStateListener.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useEffect, useRef, useState } from 'react';\nimport { AppState, AppStateStatus } from 'react-native';\n\nconst getIsAppActive = (currentAppState: AppStateStatus) => {\n return currentAppState !== 'background' && currentAppState !== 'inactive';\n};\n\nexport const useAppStateListener = () => {\n const appState = useRef(AppState.currentState);\n const [isAppActive, setIsAppActive] = useState<boolean>(getIsAppActive(appState.current));\n\n useEffect(() => {\n const subscription = AppState.addEventListener('change', nextAppState => {\n appState.current = nextAppState;\n setIsAppActive(getIsAppActive(appState.current));\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return isAppActive;\n};\n"],"mappings":"AAAA;AACA,SAASA,SAAT,EAAoBC,MAApB,EAA4BC,QAA5B,QAA4C,OAA5C;AACA,SAASC,QAAT,QAAyC,cAAzC;;AAEA,MAAMC,cAAc,GAAIC,eAAD,IAAqC;EAC1D,OAAOA,eAAe,KAAK,YAApB,IAAoCA,eAAe,KAAK,UAA/D;AACD,CAFD;;AAIA,OAAO,MAAMC,mBAAmB,GAAG,MAAM;EACvC,MAAMC,QAAQ,GAAGN,MAAM,CAACE,QAAQ,CAACK,YAAV,CAAvB;EACA,MAAM,CAACC,WAAD,EAAcC,cAAd,IAAgCR,QAAQ,CAAUE,cAAc,CAACG,QAAQ,CAACI,OAAV,CAAxB,CAA9C;EAEAX,SAAS,CAAC,MAAM;IACd,MAAMY,YAAY,GAAGT,QAAQ,CAACU,gBAAT,CAA0B,QAA1B,EAAoCC,YAAY,IAAI;MACvEP,QAAQ,CAACI,OAAT,GAAmBG,YAAnB;MACAJ,cAAc,CAACN,cAAc,CAACG,QAAQ,CAACI,OAAV,CAAf,CAAd;IACD,CAHoB,CAArB;IAKA,OAAO,MAAM;MACXC,YAAY,CAACG,MAAb;IACD,CAFD;EAGD,CATQ,EASN,EATM,CAAT;EAWA,OAAON,WAAP;AACD,CAhBM"}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from './components'\n"],"mappings":"AAAA,cAAc,cAAd"}
|
|
1
|
+
{"version":3,"names":["UnitSDK","UNEnvironment"],"sources":["index.tsx"],"sourcesContent":["export * from './components';\n\nexport * from './sharedTypes';\n\nexport { UnitSDK, UNEnvironment } from './unitSdkManager/UnitSdkManager';\n"],"mappings":"AAAA,cAAc,cAAd;AAEA,cAAc,eAAd;AAEA,SAASA,OAAT,EAAkBC,aAAlB,QAAuC,iCAAvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeMessage"],"sources":["index.ts"],"sourcesContent":["export enum NativeMessage {\n IS_SCRIPT_FETCHED = 'isScriptFetched'\n}\n"],"mappings":"AAAA,WAAYA,aAAZ;;WAAYA,a;EAAAA,a;GAAAA,a,KAAAA,a"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BookPaymentMessage"],"sources":["bookPaymentMessage.ts"],"sourcesContent":["import type { UNBookPaymentData } from '../../sharedTypes';\n\nexport enum BookPaymentMessage {\n PAYMENT_CREATED = 'unitPaymentCreated'\n}\n\nexport interface PaymentCreatedEvent {\n data: UNBookPaymentData\n}\n\nexport type BookPaymentEvent =\n| PaymentCreatedEvent\n"],"mappings":"AAEA,WAAYA,kBAAZ;;WAAYA,kB;EAAAA,kB;GAAAA,kB,KAAAA,kB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CardMessage"],"sources":["cardMessage.ts"],"sourcesContent":["import type { UNCardData } from '../../sharedTypes';\n\nexport enum CardMessage {\n CARD_STATUS_CHANGED = 'unitCardStatusChanged'\n}\n\nexport interface CardStatusChangedEvent {\n card: UNCardData;\n}\n\nexport type CardEvent =\n | CardStatusChangedEvent\n"],"mappings":"AAEA,WAAYA,WAAZ;;WAAYA,W;EAAAA,W;GAAAA,W,KAAAA,W"}
|