react-native-unit-components 0.1.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.
Files changed (89) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +2 -0
  3. package/android/build.gradle +145 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +4 -0
  6. package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +16 -0
  7. package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsViewManager.kt +19 -0
  8. package/ios/UnitReactNativeComponents-Bridging-Header.h +1 -0
  9. package/ios/UnitReactNativeComponents.xcodeproj/project.pbxproj +283 -0
  10. package/ios/UnitReactNativeComponents.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  11. package/ios/UnitReactNativeComponents.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  12. package/ios/UnitReactNativeComponents.xcodeproj/project.xcworkspace/xcuserdata/alonshprung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  13. package/ios/UnitReactNativeComponents.xcodeproj/xcuserdata/alonshprung.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  14. package/ios/UnitReactNativeComponentsViewManager.m +7 -0
  15. package/ios/UnitReactNativeComponentsViewManager.swift +36 -0
  16. package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +143 -0
  17. package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js.map +1 -0
  18. package/lib/commonjs/components/Card/CardComponent.js +97 -0
  19. package/lib/commonjs/components/Card/CardComponent.js.map +1 -0
  20. package/lib/commonjs/components/index.js +32 -0
  21. package/lib/commonjs/components/index.js.map +1 -0
  22. package/lib/commonjs/helpers/BottomSheet.js +274 -0
  23. package/lib/commonjs/helpers/BottomSheet.js.map +1 -0
  24. package/lib/commonjs/helpers/EventBus.js +79 -0
  25. package/lib/commonjs/helpers/EventBus.js.map +1 -0
  26. package/lib/commonjs/index.js +19 -0
  27. package/lib/commonjs/index.js.map +1 -0
  28. package/lib/commonjs/nativeComponenet/NativeComponentExample.js +19 -0
  29. package/lib/commonjs/nativeComponenet/NativeComponentExample.js.map +1 -0
  30. package/lib/commonjs/webComponent/WebComponent.js +75 -0
  31. package/lib/commonjs/webComponent/WebComponent.js.map +1 -0
  32. package/lib/commonjs/webComponent/html.js +79 -0
  33. package/lib/commonjs/webComponent/html.js.map +1 -0
  34. package/lib/commonjs/webComponent/webMessages/cardMessage.js +13 -0
  35. package/lib/commonjs/webComponent/webMessages/cardMessage.js.map +1 -0
  36. package/lib/commonjs/webComponent/webMessages/pageMessage.js +14 -0
  37. package/lib/commonjs/webComponent/webMessages/pageMessage.js.map +1 -0
  38. package/lib/commonjs/webComponent/webMessages/unitMessages.js +17 -0
  39. package/lib/commonjs/webComponent/webMessages/unitMessages.js.map +1 -0
  40. package/lib/module/components/BottomSheet/BottomSheetComponent.js +118 -0
  41. package/lib/module/components/BottomSheet/BottomSheetComponent.js.map +1 -0
  42. package/lib/module/components/Card/CardComponent.js +75 -0
  43. package/lib/module/components/Card/CardComponent.js.map +1 -0
  44. package/lib/module/components/index.js +3 -0
  45. package/lib/module/components/index.js.map +1 -0
  46. package/lib/module/helpers/BottomSheet.js +252 -0
  47. package/lib/module/helpers/BottomSheet.js.map +1 -0
  48. package/lib/module/helpers/EventBus.js +69 -0
  49. package/lib/module/helpers/EventBus.js.map +1 -0
  50. package/lib/module/index.js +2 -0
  51. package/lib/module/index.js.map +1 -0
  52. package/lib/module/nativeComponenet/NativeComponentExample.js +10 -0
  53. package/lib/module/nativeComponenet/NativeComponentExample.js.map +1 -0
  54. package/lib/module/webComponent/WebComponent.js +49 -0
  55. package/lib/module/webComponent/WebComponent.js.map +1 -0
  56. package/lib/module/webComponent/html.js +72 -0
  57. package/lib/module/webComponent/html.js.map +1 -0
  58. package/lib/module/webComponent/webMessages/cardMessage.js +6 -0
  59. package/lib/module/webComponent/webMessages/cardMessage.js.map +1 -0
  60. package/lib/module/webComponent/webMessages/pageMessage.js +7 -0
  61. package/lib/module/webComponent/webMessages/pageMessage.js.map +1 -0
  62. package/lib/module/webComponent/webMessages/unitMessages.js +10 -0
  63. package/lib/module/webComponent/webMessages/unitMessages.js.map +1 -0
  64. package/lib/typescript/components/BottomSheet/BottomSheetComponent.d.ts +1 -0
  65. package/lib/typescript/components/Card/CardComponent.d.ts +6 -0
  66. package/lib/typescript/components/index.d.ts +2 -0
  67. package/lib/typescript/helpers/BottomSheet.d.ts +34 -0
  68. package/lib/typescript/helpers/EventBus.d.ts +15 -0
  69. package/lib/typescript/index.d.ts +1 -0
  70. package/lib/typescript/nativeComponenet/NativeComponentExample.d.ts +7 -0
  71. package/lib/typescript/webComponent/WebComponent.d.ts +23 -0
  72. package/lib/typescript/webComponent/html.d.ts +2 -0
  73. package/lib/typescript/webComponent/webMessages/cardMessage.d.ts +7 -0
  74. package/lib/typescript/webComponent/webMessages/pageMessage.d.ts +8 -0
  75. package/lib/typescript/webComponent/webMessages/unitMessages.d.ts +24 -0
  76. package/package.json +152 -0
  77. package/src/components/BottomSheet/BottomSheetComponent.tsx +113 -0
  78. package/src/components/Card/CardComponent.tsx +75 -0
  79. package/src/components/index.ts +2 -0
  80. package/src/helpers/BottomSheet.tsx +277 -0
  81. package/src/helpers/EventBus.ts +58 -0
  82. package/src/index.tsx +1 -0
  83. package/src/nativeComponenet/NativeComponentExample.tsx +26 -0
  84. package/src/webComponent/WebComponent.tsx +75 -0
  85. package/src/webComponent/html.ts +72 -0
  86. package/src/webComponent/webMessages/cardMessage.ts +10 -0
  87. package/src/webComponent/webMessages/pageMessage.ts +11 -0
  88. package/src/webComponent/webMessages/unitMessages.ts +31 -0
  89. package/unit-react-native-components.podspec +35 -0
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UNBottomSheetComponent = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _WebComponent = require("../../webComponent/WebComponent");
11
+
12
+ var _reactNative = require("react-native");
13
+
14
+ var _BottomSheet = _interopRequireDefault(require("../../helpers/BottomSheet"));
15
+
16
+ var _EventBus = _interopRequireWildcard(require("../../helpers/EventBus"));
17
+
18
+ var _pageMessage = require("../../webComponent/webMessages/pageMessage");
19
+
20
+ var _unitMessages = require("../../webComponent/webMessages/unitMessages");
21
+
22
+ var _cardMessage = require("../../webComponent/webMessages/cardMessage");
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+
26
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
+
28
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
+
30
+ const UNBottomSheetComponent = () => {
31
+ const [isActive, setIsActive] = (0, _react.useState)(false);
32
+ const [height, setHeight] = (0, _react.useState)(0);
33
+ const [renderingRequest, setRenderingRequest] = (0, _react.useState)(null);
34
+ const [waitForLoadingNewComponent, setWaitForLoadingNewComponent] = (0, _react.useState)(false);
35
+ const [newHeightMessage, setNewHeightMessage] = (0, _react.useState)(null);
36
+ const webRef = (0, _react.useRef)(null);
37
+
38
+ const _listener = data => {
39
+ setRenderingRequest(data);
40
+ setIsActive(true);
41
+ };
42
+
43
+ (0, _react.useEffect)(() => {
44
+ if (!webRef.current) return;
45
+
46
+ if (renderingRequest) {
47
+ var _webRef$current;
48
+
49
+ (_webRef$current = webRef.current) === null || _webRef$current === void 0 ? void 0 : _webRef$current.injectJavaScript(`dispatchRenderingEvent('${renderingRequest}')`);
50
+ }
51
+ }, [webRef.current, renderingRequest]);
52
+ (0, _react.useEffect)(() => {
53
+ if (!isActive) {
54
+ setHeight(0);
55
+ setRenderingRequest(null);
56
+ }
57
+ }, [isActive]);
58
+ (0, _react.useEffect)(() => {
59
+ if (!waitForLoadingNewComponent && newHeightMessage) {
60
+ setWaitForLoadingNewComponent(false);
61
+ setNewHeight(newHeightMessage);
62
+ }
63
+ }, [waitForLoadingNewComponent, newHeightMessage]);
64
+ (0, _react.useEffect)(() => {
65
+ _EventBus.default.Instance.addListener(_EventBus.BusEvent.REQUEST_RENDERING, _listener);
66
+
67
+ return () => {
68
+ _EventBus.default.Instance.removeListener(_listener);
69
+ };
70
+ }, []);
71
+
72
+ const getBottomSheetScript = () => {
73
+ return `
74
+ window.addEventListener("unitRequestRefresh", (e) => {
75
+ postMessageToSDK({ type: "unitRequestRefresh", details: e.detail })
76
+ });
77
+ `;
78
+ };
79
+
80
+ const setNewHeight = message => {
81
+ if (renderingRequest) {
82
+ const nativePlace = JSON.parse(renderingRequest).nativePlace;
83
+
84
+ if (nativePlace == 'overFullScreen') {
85
+ const windowHeight = _reactNative.Dimensions.get('window').height * 0.94;
86
+ setHeight(windowHeight);
87
+ } else {
88
+ setHeight(message.details.height);
89
+ }
90
+ }
91
+ };
92
+
93
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
94
+ pointerEvents: isActive ? undefined : 'none',
95
+ style: {
96
+ position: 'absolute',
97
+ top: 0,
98
+ bottom: 0,
99
+ left: 0,
100
+ right: 0
101
+ }
102
+ }, /*#__PURE__*/_react.default.createElement(_BottomSheet.default, {
103
+ isOpen: isActive,
104
+ onClose: () => setIsActive(false),
105
+ onOpen: () => setIsActive(true)
106
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
107
+ style: {
108
+ height,
109
+ paddingTop: height === 0 ? 0 : 10
110
+ }
111
+ }, /*#__PURE__*/_react.default.createElement(_WebComponent.WebComponent, {
112
+ ref: webRef,
113
+ type: _WebComponent.WebComponentType.slot,
114
+ script: getBottomSheetScript(),
115
+ onMessage: message => {
116
+ if (renderingRequest && message.type == _pageMessage.PageMessage.PAGE_HEIGHT) {
117
+ setNewHeightMessage(message);
118
+ } else if (message.type == _unitMessages.UnitMessage.UNIT_REQUEST_RENDERING) {
119
+ const {
120
+ data
121
+ } = message.details;
122
+
123
+ if (data != renderingRequest) {
124
+ setHeight(0);
125
+ setRenderingRequest(data);
126
+ setWaitForLoadingNewComponent(true);
127
+ setTimeout(() => setWaitForLoadingNewComponent(false), 400);
128
+ }
129
+ } else if (message.type == _cardMessage.CardMessage.CARD_STATUS_CHANGE) {
130
+ _EventBus.default.Instance.event(_EventBus.BusEvent.CARD_STATUS_CHANGED, message.details.card);
131
+ } else if (message.type == _unitMessages.UnitMessage.UNIT_REQUEST_CLOSE_FLOW) {
132
+ setIsActive(false);
133
+ } else if (message.type == _unitMessages.UnitMessage.UNIT_REQUEST_OPEN_LINK) {
134
+ const href = message.details.href;
135
+
136
+ _reactNative.Linking.openURL(href);
137
+ }
138
+ }
139
+ })))));
140
+ };
141
+
142
+ exports.UNBottomSheetComponent = UNBottomSheetComponent;
143
+ //# sourceMappingURL=BottomSheetComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UNBottomSheetComponent","isActive","setIsActive","useState","height","setHeight","renderingRequest","setRenderingRequest","waitForLoadingNewComponent","setWaitForLoadingNewComponent","newHeightMessage","setNewHeightMessage","webRef","useRef","_listener","data","useEffect","current","injectJavaScript","setNewHeight","EventBus","Instance","addListener","BusEvent","REQUEST_RENDERING","removeListener","getBottomSheetScript","message","nativePlace","JSON","parse","windowHeight","Dimensions","get","details","undefined","position","top","bottom","left","right","paddingTop","WebComponentType","slot","type","PageMessage","PAGE_HEIGHT","UnitMessage","UNIT_REQUEST_RENDERING","setTimeout","CardMessage","CARD_STATUS_CHANGE","event","CARD_STATUS_CHANGED","card","UNIT_REQUEST_CLOSE_FLOW","UNIT_REQUEST_OPEN_LINK","href","Linking","openURL"],"sources":["BottomSheetComponent.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\"\nimport type WebView from \"react-native-webview\"\nimport { WebComponent, WebComponentType, WebViewMessage } from \"../../webComponent/WebComponent\"\nimport { Dimensions, Linking, View } from \"react-native\"\nimport BottomSheet from \"../../helpers/BottomSheet\"\nimport EventBus, { BusEvent } from \"../../helpers/EventBus\"\nimport { HeightEvent, PageMessage } from \"../../webComponent/webMessages/pageMessage\"\nimport { RequestOpenLinkEvent, RequestRenderingData, RequestRenderingEvent, UnitMessage } from \"../../webComponent/webMessages/unitMessages\"\nimport { CardMessage, CardStatusChangedEvent } from \"../../webComponent/webMessages/cardMessage\"\n\nexport const UNBottomSheetComponent = () => {\n const [isActive, setIsActive] = useState(false)\n const [height, setHeight] = useState(0)\n\n const [renderingRequest, setRenderingRequest] = useState<string | null>(null)\n\n const [waitForLoadingNewComponent, setWaitForLoadingNewComponent] = useState(false)\n const [newHeightMessage, setNewHeightMessage] = useState<WebViewMessage | null>(null)\n\n const webRef = useRef<WebView>(null)\n\n const _listener = (data: string) => {\n setRenderingRequest(data)\n setIsActive(true)\n }\n\n useEffect(() => {\n if (!webRef.current) return\n if (renderingRequest) {\n webRef.current?.injectJavaScript(`dispatchRenderingEvent('${renderingRequest}')`)\n }\n }, [webRef.current, renderingRequest])\n\n useEffect(() => {\n if (!isActive) {\n setHeight(0)\n setRenderingRequest(null)\n }\n }, [isActive])\n\n useEffect(() => {\n if (!waitForLoadingNewComponent && newHeightMessage) {\n setWaitForLoadingNewComponent(false)\n setNewHeight(newHeightMessage)\n }\n }, [waitForLoadingNewComponent, newHeightMessage])\n\n useEffect(() => {\n EventBus.Instance.addListener(BusEvent.REQUEST_RENDERING, _listener)\n\n return (() => {\n EventBus.Instance.removeListener(_listener)\n })\n }, [])\n\n const getBottomSheetScript = () => {\n return `\n window.addEventListener(\"unitRequestRefresh\", (e) => {\n postMessageToSDK({ type: \"unitRequestRefresh\", details: e.detail })\n });\n `\n }\n\n const setNewHeight = (message: WebViewMessage) => {\n if (renderingRequest) {\n const nativePlace = (JSON.parse(renderingRequest) as RequestRenderingData).nativePlace;\n if (nativePlace == 'overFullScreen') {\n const windowHeight = Dimensions.get('window').height * 0.94;\n setHeight(windowHeight)\n } else {\n setHeight((message.details as HeightEvent).height)\n }\n }\n }\n\n return (\n <>\n <View\n pointerEvents={isActive ? undefined : 'none'}\n style={{ position: 'absolute', top: 0, bottom: 0, left: 0, right: 0 }}\n >\n <BottomSheet\n isOpen={isActive}\n onClose={() => setIsActive(false)}\n onOpen={() => setIsActive(true)}\n >\n <View style={{ height, paddingTop: height === 0 ? 0 : 10 }}>\n <WebComponent ref={webRef} type={WebComponentType.slot} script={getBottomSheetScript()} onMessage={message => {\n if (renderingRequest && message.type == PageMessage.PAGE_HEIGHT) {\n setNewHeightMessage(message)\n } else if (message.type == UnitMessage.UNIT_REQUEST_RENDERING) {\n const { data } = (message.details! as RequestRenderingEvent)\n if (data != renderingRequest) {\n setHeight(0)\n setRenderingRequest(data)\n setWaitForLoadingNewComponent(true)\n setTimeout(() => setWaitForLoadingNewComponent(false), 400)\n }\n } else if (message.type == CardMessage.CARD_STATUS_CHANGE) {\n EventBus.Instance.event(BusEvent.CARD_STATUS_CHANGED, (message.details as CardStatusChangedEvent).card)\n } else if (message.type == UnitMessage.UNIT_REQUEST_CLOSE_FLOW) {\n setIsActive(false)\n } else if (message.type == UnitMessage.UNIT_REQUEST_OPEN_LINK) {\n const href = (message.details as RequestOpen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QAC7D,MAAMC,IAAI,GAAI9B,OAAO,CAACO,OAAT,CAA0CuB,IAAvD;;QACAC,oBAAA,CAAQC,OAAR,CAAgBF,IAAhB;MACD;IACF;EAnBD,EADF,CALF,CAJF,CADF,CADF;AAqCD,CAtGM"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UNCardComponent = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _pageMessage = require("../../webComponent/webMessages/pageMessage");
13
+
14
+ var _unitMessages = require("../../webComponent/webMessages/unitMessages");
15
+
16
+ var _EventBus = _interopRequireWildcard(require("../../helpers/EventBus"));
17
+
18
+ var _WebComponent = require("../../webComponent/WebComponent");
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ const UNCardComponent = props => {
25
+ const [height, setHeight] = (0, _react.useState)(0);
26
+ const [requestRefreshEvent, setRequestRefreshEvent] = (0, _react.useState)(null);
27
+ const webRef = (0, _react.useRef)(null);
28
+ (0, _react.useEffect)(() => {
29
+ _EventBus.default.Instance.addListener(_EventBus.BusEvent.CARD_STATUS_CHANGED, _cardStatusChanged);
30
+
31
+ _EventBus.default.Instance.addListener(_EventBus.BusEvent.REQUEST_REFRESH, _requestRefresh);
32
+
33
+ return () => {
34
+ _EventBus.default.Instance.removeListener(_cardStatusChanged);
35
+
36
+ _EventBus.default.Instance.removeListener(_requestRefresh);
37
+ };
38
+ }, []);
39
+
40
+ const _cardStatusChanged = card => {
41
+ if (props.onStatusChanged) {
42
+ props.onStatusChanged(card);
43
+ }
44
+ };
45
+
46
+ const _requestRefresh = data => {
47
+ setRequestRefreshEvent(data);
48
+ };
49
+
50
+ (0, _react.useEffect)(() => {
51
+ if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(_WebComponent.WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == props.cardId) {
52
+ var _webRef$current;
53
+
54
+ (_webRef$current = webRef.current) === null || _webRef$current === void 0 ? void 0 : _webRef$current.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
55
+ }
56
+ }, [requestRefreshEvent]);
57
+
58
+ const getCardParams = () => {
59
+ return `
60
+ cardId="${props.cardId}"
61
+ customerToken="${props.customerToken}"
62
+ src="https://d1xlopvhx2cz8k.cloudfront.net/resources/outlay.json"
63
+ `;
64
+ };
65
+
66
+ const getCardScript = () => {
67
+ return `
68
+ const dispatchRefreshEvent = (details) => {
69
+ const event = new CustomEvent("unitRequestRefresh",{ detail: JSON.parse(details) })
70
+ window.dispatchEvent(event)
71
+ }
72
+ `;
73
+ };
74
+
75
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
76
+ style: {
77
+ height
78
+ }
79
+ }, /*#__PURE__*/_react.default.createElement(_WebComponent.WebComponent, {
80
+ ref: webRef,
81
+ type: _WebComponent.WebComponentType.card,
82
+ params: getCardParams(),
83
+ script: getCardScript(),
84
+ onMessage: message => {
85
+ if (message.type === _unitMessages.UnitMessage.UNIT_REQUEST_RENDERING) {
86
+ _EventBus.default.Instance.event(_EventBus.BusEvent.REQUEST_RENDERING, message.details.data);
87
+ }
88
+
89
+ if (message.type == _pageMessage.PageMessage.PAGE_HEIGHT) {
90
+ setHeight(message.details.height);
91
+ }
92
+ }
93
+ }));
94
+ };
95
+
96
+ exports.UNCardComponent = UNCardComponent;
97
+ //# sourceMappingURL=CardComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UNCardComponent","props","height","setHeight","useState","requestRefreshEvent","setRequestRefreshEvent","webRef","useRef","useEffect","EventBus","Instance","addListener","BusEvent","CARD_STATUS_CHANGED","_cardStatusChanged","REQUEST_REFRESH","_requestRefresh","removeListener","card","onStatusChanged","data","dependencies","includes","WebComponentType","valueOf","resourceId","cardId","current","injectJavaScript","JSON","stringify","getCardParams","customerToken","getCardScript","message","type","UnitMessage","UNIT_REQUEST_RENDERING","event","REQUEST_RENDERING","details","PageMessage","PAGE_HEIGHT"],"sources":["CardComponent.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\"\nimport { View } from \"react-native\";\nimport type WebView from \"react-native-webview\";\nimport { HeightEvent, PageMessage } from \"../../webComponent/webMessages/pageMessage\";\nimport { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from \"../../webComponent/webMessages/unitMessages\";\nimport EventBus, { BusEvent } from \"../../helpers/EventBus\"\nimport { WebComponent, WebComponentType } from \"../../webComponent/WebComponent\"\n\nexport interface UNCardComponentProps {\n cardId: string;\n customerToken: string;\n onStatusChanged?: (card: any) => void; // TODO - UNCard\n}\n\nexport const UNCardComponent = (props: UNCardComponentProps) => {\n const [height, setHeight] = useState(0)\n const [requestRefreshEvent, setRequestRefreshEvent] = useState<RequestRefreshEvent | null>(null)\n\n const webRef = useRef<WebView>(null)\n\n useEffect(() => {\n EventBus.Instance.addListener(BusEvent.CARD_STATUS_CHANGED, _cardStatusChanged)\n EventBus.Instance.addListener(BusEvent.REQUEST_REFRESH, _requestRefresh)\n return (() => {\n EventBus.Instance.removeListener(_cardStatusChanged)\n EventBus.Instance.removeListener(_requestRefresh)\n })\n }, [])\n\n const _cardStatusChanged = (card: any) => {\n if (props.onStatusChanged) {\n props.onStatusChanged(card)\n }\n }\n\n const _requestRefresh = (data: RequestRefreshEvent) => {\n setRequestRefreshEvent(data)\n }\n\n useEffect(() => {\n if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == props.cardId) {\n webRef.current?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`)\n }\n }, [requestRefreshEvent])\n\n const getCardParams = () => {\n return `\n cardId=\"${props.cardId}\"\n customerToken=\"${props.customerToken}\"\n src=\"https://d1xlopvhx2cz8k.cloudfront.net/resources/outlay.json\"\n `\n }\n\n const getCardScript = () => {\n return `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"unitRequestRefresh\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n `\n }\n\n return (\n <View style={{ height }}>\n <WebComponent ref={webRef} type={WebComponentType.card} params={getCardParams()} script={getCardScript()} onMessage={message => {\n if (message.type === UnitMessage.UNIT_REQUEST_RENDERING) {\n EventBus.Instance.event(BusEvent.REQUEST_RENDERING, (message.details as RequestRenderingEvent).data)\n }\n if (message.type == PageMessage.PAGE_HEIGHT) {\n setHeight((message.details as HeightEvent).height)\n }\n }} />\n </View>\n )\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAQO,MAAMA,eAAe,GAAIC,KAAD,IAAiC;EAC9D,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsB,IAAAC,eAAA,EAAS,CAAT,CAA5B;EACA,MAAM,CAACC,mBAAD,EAAsBC,sBAAtB,IAAgD,IAAAF,eAAA,EAAqC,IAArC,CAAtD;EAEA,MAAMG,MAAM,GAAG,IAAAC,aAAA,EAAgB,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;AACA,KALI;EAMD,CAPD;;EASA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAE;MAAEhC;IAAF;EAAb,gBACE,6BAAC,0BAAD;IAAc,GAAG,EAAEK,MAAnB;IAA2B,IAAI,EAAEiB,8BAAA,CAAiBL,IAAlD;IAAwD,MAAM,EAAEa,aAAa,EAA7E;IAAiF,MAAM,EAAEE,aAAa,EAAtG;IAA0G,SAAS,EAAEC,OAAO,IAAI;MAC9H,IAAIA,OAAO,CAACC,IAAR,KAAiBC,yBAAA,CAAYC,sBAAjC,EAAyD;QACvD5B,iBAAA,CAASC,QAAT,CAAkB4B,KAAlB,CAAwB1B,kBAAA,CAAS2B,iBAAjC,EAAqDL,OAAO,CAACM,OAAT,CAA2CpB,IAA/F;MACD;;MACD,IAAIc,OAAO,CAACC,IAAR,IAAgBM,wBAAA,CAAYC,WAAhC,EAA6C;QAC3CxC,SAAS,CAAEgC,OAAO,CAACM,OAAT,CAAiCvC,MAAlC,CAAT;MACD;IACF;EAPD,EADF,CADF;AAYD,CA5DM"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _CardComponent = require("./Card/CardComponent");
8
+
9
+ Object.keys(_CardComponent).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _CardComponent[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _CardComponent[key];
16
+ }
17
+ });
18
+ });
19
+
20
+ var _BottomSheetComponent = require("./BottomSheet/BottomSheetComponent");
21
+
22
+ Object.keys(_BottomSheetComponent).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _BottomSheetComponent[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _BottomSheetComponent[key];
29
+ }
30
+ });
31
+ });
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './Card/CardComponent'\nexport * from './BottomSheet/BottomSheetComponent'\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,274 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
+
18
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+
20
+ 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); }
21
+
22
+ const BottomSheet = props => {
23
+ const panelHeightValue = (0, _react.useRef)(new _reactNative.Animated.Value(props.sliderMaxHeight)).current;
24
+ const fadeAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
25
+ const [isPanelOpened, setIsPanelOpened] = (0, _react.useState)(props.isOpen);
26
+ const [contentHeight, setContentHeight] = (0, _react.useState)(undefined);
27
+ const [currentHeight, setCurrentHeight] = (0, _react.useState)(props.sliderMaxHeight);
28
+ const [dy, setDy] = (0, _react.useState)(0);
29
+
30
+ const _parentPanResponder = _reactNative.PanResponder.create({
31
+ onMoveShouldSetPanResponderCapture: (_, gestureState) => {
32
+ return Math.abs(gestureState.dy) > 10;
33
+ },
34
+
35
+ onPanResponderMove(_, gestureState) {
36
+ if (currentHeight + gestureState.dy < 0) return;
37
+ if (!props.expandToMaxHeightEnabled && currentHeight + gestureState.dy < sliderMaxHeight - contentHeight) return;
38
+ panelHeightValue.setValue(currentHeight + gestureState.dy);
39
+ setDy(gestureState.dy);
40
+ },
41
+
42
+ onPanResponderRelease: () => {
43
+ if (dy > 0) {
44
+ collapse();
45
+ } else if (!props.expandToMaxHeightEnabled) {
46
+ setToContentHeight(contentHeight);
47
+ } else if (dy < 0) {
48
+ expand();
49
+ } else {
50
+ expand();
51
+ }
52
+ }
53
+ });
54
+
55
+ (0, _react.useEffect)(() => {
56
+ if (props.isOpen && !isPanelOpened) {
57
+ fadeIn();
58
+ } else if (isPanelOpened) {
59
+ setContentHeight(0);
60
+
61
+ _dismiss();
62
+ }
63
+ }, [props.isOpen]);
64
+ (0, _react.useEffect)(() => {
65
+ _reactNative.BackHandler.addEventListener('hardwareBackPress', _onBackPress);
66
+
67
+ const id = panelHeightValue.addListener(e => setCurrentHeight(e.value));
68
+ return () => {
69
+ _reactNative.BackHandler.removeEventListener('hardwareBackPress', _onBackPress);
70
+
71
+ panelHeightValue.removeListener(id);
72
+ };
73
+ }, []);
74
+
75
+ const fadeIn = () => {
76
+ _reactNative.Animated.timing(fadeAnim, {
77
+ toValue: 0.3,
78
+ duration: 500,
79
+ useNativeDriver: false
80
+ }).start(() => {
81
+ setIsPanelOpened(true);
82
+ });
83
+ };
84
+
85
+ const fadeOut = () => {
86
+ _reactNative.Animated.timing(fadeAnim, {
87
+ toValue: 0,
88
+ duration: 500,
89
+ useNativeDriver: false
90
+ }).start(() => {
91
+ setIsPanelOpened(false);
92
+ props.onClose();
93
+ });
94
+ };
95
+
96
+ const setToContentHeight = contentHeight => {
97
+ _reactNative.Animated.timing(panelHeightValue, {
98
+ duration: props.animationDuration,
99
+ easing: _reactNative.Easing.quad,
100
+ toValue: sliderMaxHeight - contentHeight,
101
+ useNativeDriver: false
102
+ }).start();
103
+ };
104
+
105
+ const expand = () => {
106
+ const {
107
+ animationDuration
108
+ } = props;
109
+
110
+ if (currentHeight > sliderMaxHeight - contentHeight) {
111
+ setToContentHeight(contentHeight);
112
+ return;
113
+ }
114
+
115
+ _reactNative.Animated.timing(panelHeightValue, {
116
+ duration: animationDuration,
117
+ easing: _reactNative.Easing.quad,
118
+ toValue: 0,
119
+ useNativeDriver: false
120
+ }).start();
121
+ };
122
+
123
+ const collapse = () => {
124
+ if (currentHeight > sliderMaxHeight - contentHeight) {
125
+ _dismiss();
126
+
127
+ return;
128
+ }
129
+
130
+ setToContentHeight(contentHeight); // Animated.timing(panelHeightValue, {
131
+ // duration: animationDuration,
132
+ // easing: Easing.quad,
133
+ // toValue: sliderMaxHeight - contentHeight!,
134
+ // useNativeDriver: false,
135
+ // }).start(() => {
136
+ // const isPanelOpenedNewValue = !isPanelOpened
137
+ // setIsPanelOpened(isPanelOpenedNewValue)
138
+ // if (isPanelOpenedNewValue) {
139
+ // // onOpen();
140
+ // } else {
141
+ // // onClose();
142
+ // Keyboard.dismiss();
143
+ // }
144
+ // });
145
+ };
146
+
147
+ const _onBackPress = () => {
148
+ isPanelOpened && collapse();
149
+ return isPanelOpened;
150
+ };
151
+
152
+ const _setSize = e => {
153
+ let newContentHeight = e.nativeEvent.layout.height;
154
+ if (newContentHeight !== 0) newContentHeight += 42;
155
+ setContentHeight(newContentHeight);
156
+ setToContentHeight(newContentHeight);
157
+ };
158
+
159
+ const _dismiss = () => {
160
+ const {
161
+ animationDuration
162
+ } = props;
163
+
164
+ _reactNative.Animated.timing(panelHeightValue, {
165
+ duration: animationDuration,
166
+ easing: _reactNative.Easing.quad,
167
+ toValue: sliderMaxHeight,
168
+ useNativeDriver: false
169
+ }).start(() => {});
170
+
171
+ fadeOut();
172
+ };
173
+
174
+ const {
175
+ sliderMaxHeight,
176
+ children
177
+ } = props;
178
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
179
+ style: {
180
+ position: 'absolute',
181
+ top: 0,
182
+ bottom: 0,
183
+ right: 0,
184
+ left: 0
185
+ },
186
+ activeOpacity: 1,
187
+ onPress: _dismiss
188
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
189
+ style: {
190
+ backgroundColor: 'black',
191
+ flex: 1,
192
+ opacity: fadeAnim
193
+ }
194
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, _extends({}, _parentPanResponder.panHandlers, {
195
+ style: { ...styles.container,
196
+ height: sliderMaxHeight,
197
+ transform: [{
198
+ translateY: panelHeightValue
199
+ }]
200
+ }
201
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
202
+ style: styles.outerContent
203
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
204
+ activeOpacity: 1
205
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
206
+ style: styles.lineContainer
207
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
208
+ style: styles.line
209
+ }))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
210
+ onLayout: _setSize,
211
+ style: [styles.innerContent]
212
+ }, children))));
213
+ };
214
+
215
+ BottomSheet.propTypes = {
216
+ children: _propTypes.default.oneOfType([_propTypes.default.node]),
217
+ isOpen: _propTypes.default.bool,
218
+ sliderMaxHeight: _propTypes.default.number,
219
+ animation: _propTypes.default.func,
220
+ animationDuration: _propTypes.default.number,
221
+ onOpen: _propTypes.default.func,
222
+ onClose: _propTypes.default.func,
223
+ expandToMaxHeightEnabled: _propTypes.default.bool
224
+ };
225
+ BottomSheet.defaultProps = {
226
+ children: /*#__PURE__*/_react.default.createElement(_reactNative.View, null),
227
+ isOpen: true,
228
+ sliderMaxHeight: _reactNative.Dimensions.get('window').height * 0.95,
229
+ animationDuration: 200,
230
+ onOpen: () => null,
231
+ onClose: () => null,
232
+ expandToMaxHeightEnabled: false
233
+ };
234
+
235
+ const styles = _reactNative.StyleSheet.create({
236
+ container: {
237
+ flex: 1,
238
+ marginTop: 60,
239
+ paddingHorizontal: 12,
240
+ shadowColor: '#000000',
241
+ shadowOffset: {
242
+ width: 0,
243
+ height: 6
244
+ },
245
+ shadowOpacity: 0.37,
246
+ shadowRadius: 7.49,
247
+ elevation: 12,
248
+ borderTopLeftRadius: 15,
249
+ borderTopRightRadius: 15,
250
+ backgroundColor: '#ffffff'
251
+ },
252
+ lineContainer: {
253
+ borderTopLeftRadius: 30,
254
+ borderTopRightRadius: 30,
255
+ alignItems: 'center'
256
+ },
257
+ line: {
258
+ width: 35,
259
+ height: 4,
260
+ borderRadius: 2,
261
+ marginTop: 18,
262
+ backgroundColor: '#D5DDE0'
263
+ },
264
+ outerContent: {
265
+ flex: -1
266
+ },
267
+ innerContent: {
268
+ flex: -1
269
+ }
270
+ });
271
+
272
+ var _default = BottomSheet;
273
+ exports.default = _default;
274
+ //# sourceMappingURL=BottomSheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BottomSheet","props","panelHeightValue","useRef","Animated","Value","sliderMaxHeight","current","fadeAnim","isPanelOpened","setIsPanelOpened","useState","isOpen","contentHeight","setContentHeight","undefined","currentHeight","setCurrentHeight","dy","setDy","_parentPanResponder","PanResponder","create","onMoveShouldSetPanResponderCapture","_","gestureState","Math","abs","onPanResponderMove","expandToMaxHeightEnabled","setValue","onPanResponderRelease","collapse","setToContentHeight","expand","useEffect","fadeIn","_dismiss","BackHandler","addEventListener","_onBackPress","id","addListener","e","value","removeEventListener","removeListener","timing","toValue","duration","useNativeDriver","start","fadeOut","onClose","animationDuration","easing","Easing","quad","_setSize","newContentHeight","nativeEvent","layout","height","children","position","top","bottom","right","left","backgroundColor","flex","opacity","panHandlers","styles","container","transform","translateY","outerContent","lineContainer","line","innerContent","propTypes","PropTypes","oneOfType","node","bool","number","animation","func","onOpen","defaultProps","Dimensions","get","StyleSheet","marginTop","paddingHorizontal","shadowColor","shadowOffset","width","shadowOpacity","shadowRadius","elevation","borderTopLeftRadius","borderTopRightRadius","alignItems","borderRadius"],"sources":["BottomSheet.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useRef, useState } from 'react';\nimport {\n Animated,\n BackHandler,\n Dimensions,\n Easing,\n // Keyboard,\n LayoutChangeEvent,\n PanResponder,\n StyleSheet,\n TouchableOpacity,\n View,\n} from 'react-native';\nimport PropTypes from 'prop-types';\n\nexport interface BottomSheetProps {\n isOpen: boolean\n children: ReactNode\n sliderMaxHeight: number\n onOpen: () => void\n onClose: () => void\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\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 onMoveShouldSetPanResponderCapture: (_, gestureState) => {\n return Math.abs(gestureState.dy) > 10\n },\n onPanResponderMove(_, gestureState) {\n if (currentHeight + gestureState.dy < 0) return\n if (!props.expandToMaxHeightEnabled && 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 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 (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 (currentHeight > (sliderMaxHeight - contentHeight!)) {\n _dismiss()\n return\n }\n\n setToContentHeight(contentHeight!)\n\n // Animated.timing(panelHeightValue, {\n // duration: animationDuration,\n // easing: Easing.quad,\n // toValue: sliderMaxHeight - contentHeight!,\n // useNativeDriver: false,\n // }).start(() => {\n // const isPanelOpenedNewValue = !isPanelOpened\n // setIsPanelOpened(isPanelOpenedNewValue)\n // if (isPanelOpenedNewValue) {\n // // onOpen();\n // } else {\n // // onClose();\n // Keyboard.dismiss();\n // }\n // });\n };\n\n const _onBackPress = () => {\n isPanelOpened && collapse();\n return isPanelOpened;\n };\n\n const _setSize = (e: LayoutChangeEvent) => {\n let newContentHeight = e.nativeEvent.layout.height\n if (newContentHeight !== 0) newContentHeight += 42;\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 })\n fadeOut()\n }\n\n const {\n sliderMaxHeight,\n children,\n } = props;\n\n return (\n <>\n <TouchableOpacity\n style={{ position: 'absolute', top: 0, bottom: 0, right: 0, left: 0 }} activeOpacity={1}\n onPress={_dismiss}\n >\n <Animated.View\n style={{ backgroundColor: 'black', flex: 1, opacity: fadeAnim }}\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 activeOpacity={1}>\n <View style={styles.lineContainer}>\n <View style={styles.line} />\n </View>\n </TouchableOpacity>\n <View\n onLayout={_setSize}\n style={[styles.innerContent]}\n >\n {children}\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 * 0.95,\n animationDuration: 200,\n onOpen: () => null,\n onClose: () => null,\n expandToMaxHeightEnabled: false\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n marginTop: 60,\n paddingHorizontal: 12,\n shadowColor: '#000000',\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: '#ffffff',\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: '#D5DDE0',\n },\n outerContent: {\n flex: -1,\n },\n innerContent: {\n flex: -1,\n },\n});\n\nexport default BottomSheet;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAYA;;;;;;;;;;AAYA,MAAMA,WAAW,GAAIC,KAAD,IAA6B;EAC/C,MAAMC,gBAAgB,GAAG,IAAAC,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmBJ,KAAK,CAACK,eAAzB,CAAP,EAAkDC,OAA3E;EACA,MAAMC,QAAQ,GAAG,IAAAL,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmB,CAAnB,CAAP,EAA8BE,OAA/C;EAEA,MAAM,CAACE,aAAD,EAAgBC,gBAAhB,IAAoC,IAAAC,eAAA,EAASV,KAAK,CAACW,MAAf,CAA1C;EACA,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,IAAAH,eAAA,EAA6BI,SAA7B,CAA1C;EAEA,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,IAAAN,eAAA,EAAiBV,KAAK,CAACK,eAAvB,CAA1C;EAEA,MAAM,CAACY,EAAD,EAAKC,KAAL,IAAc,IAAAR,eAAA,EAAS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