@wavemaker-ai/app-rn-runtime 1.0.0-rc.324 → 1.0.0-rc.328

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 (172) hide show
  1. package/components/advanced/offline-banner/offline-banner.component.js +68 -0
  2. package/components/advanced/offline-banner/offline-banner.component.js.map +1 -0
  3. package/components/advanced/offline-banner/offline-banner.props.js +12 -0
  4. package/components/advanced/offline-banner/offline-banner.props.js.map +1 -0
  5. package/components/advanced/offline-banner/offline-banner.styles.js +99 -0
  6. package/components/advanced/offline-banner/offline-banner.styles.js.map +1 -0
  7. package/components/advanced/webview/webview.component.js +2 -2
  8. package/components/advanced/webview/webview.component.js.map +1 -1
  9. package/components/advanced/webview/webview.props.js +1 -1
  10. package/components/advanced/webview/webview.props.js.map +1 -1
  11. package/components/basic/bottomsheet/bottomsheet.component.js +156 -14
  12. package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
  13. package/components/basic/bottomsheet/bottomsheet.styles.js +0 -3
  14. package/components/basic/bottomsheet/bottomsheet.styles.js.map +1 -1
  15. package/components/basic/progress-circle/progress-circle.component.js +3 -1
  16. package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  17. package/components/chart/area-chart/area-chart.component.js +86 -93
  18. package/components/chart/area-chart/area-chart.component.js.map +1 -1
  19. package/components/chart/area-chart/area-chart.props.js +2 -0
  20. package/components/chart/area-chart/area-chart.props.js.map +1 -1
  21. package/components/chart/bar-chart/bar-chart.component.js +79 -97
  22. package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  23. package/components/chart/basechart.component.js +117 -96
  24. package/components/chart/basechart.component.js.map +1 -1
  25. package/components/chart/basechart.props.js +12 -0
  26. package/components/chart/basechart.props.js.map +1 -1
  27. package/components/chart/basechart.styles.js.map +1 -1
  28. package/components/chart/bubble-chart/bubble-chart.component.js +72 -70
  29. package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  30. package/components/chart/bubble-chart/bubble-chart.props.js +1 -0
  31. package/components/chart/bubble-chart/bubble-chart.props.js.map +1 -1
  32. package/components/chart/line-chart/line-chart.component.js +105 -79
  33. package/components/chart/line-chart/line-chart.component.js.map +1 -1
  34. package/components/chart/pie-chart/pie-chart.component.js +70 -166
  35. package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  36. package/components/chart/pie-chart/pie-chart.props.js +1 -0
  37. package/components/chart/pie-chart/pie-chart.props.js.map +1 -1
  38. package/components/container/accordion/accordionpane/accordionpane.component.js +6 -2
  39. package/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  40. package/components/container/container.component.js +27 -1
  41. package/components/container/container.component.js.map +1 -1
  42. package/components/container/container.props.js +7 -0
  43. package/components/container/container.props.js.map +1 -1
  44. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +25 -1
  45. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
  46. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js +1 -0
  47. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js.map +1 -1
  48. package/components/container/tabs/tabheader/tabheader.component.js +5 -14
  49. package/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  50. package/components/container/tabs/tabheader/tabheader.props.js +0 -2
  51. package/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
  52. package/components/container/tabs/tabheader/tabheader.styles.js +1 -43
  53. package/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  54. package/components/container/tabs/tabpane/tabpane.component.js +6 -2
  55. package/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  56. package/components/container/tabs/tabs.component.js +2 -6
  57. package/components/container/tabs/tabs.component.js.map +1 -1
  58. package/components/container/tabs/tabs.props.js +0 -2
  59. package/components/container/tabs/tabs.props.js.map +1 -1
  60. package/components/container/wizard/wizardstep/wizardstep.component.js +28 -5
  61. package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  62. package/components/container/wizard/wizardstep/wizardstep.props.js +2 -0
  63. package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  64. package/components/data/form/form-field/form-field.component.js +1 -0
  65. package/components/data/form/form-field/form-field.component.js.map +1 -1
  66. package/components/data/form/form-field/form-field.props.js +1 -0
  67. package/components/data/form/form-field/form-field.props.js.map +1 -1
  68. package/components/data/list/list-template/list-template.component.js +3 -0
  69. package/components/data/list/list-template/list-template.component.js.map +1 -1
  70. package/components/data/list/list.component.js +6 -4
  71. package/components/data/list/list.component.js.map +1 -1
  72. package/components/data/list/list.styles.js +1 -14
  73. package/components/data/list/list.styles.js.map +1 -1
  74. package/components/input/baseinput/baseinput.component.js +7 -0
  75. package/components/input/baseinput/baseinput.component.js.map +1 -1
  76. package/components/input/calendar/calendar.component.js +4 -0
  77. package/components/input/calendar/calendar.component.js.map +1 -1
  78. package/components/input/calendar/views/month-view.js +8 -1
  79. package/components/input/calendar/views/month-view.js.map +1 -1
  80. package/components/input/checkboxset/checkboxset.component.js.map +1 -1
  81. package/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  82. package/components/input/chips/chips.component.js +3 -4
  83. package/components/input/chips/chips.component.js.map +1 -1
  84. package/components/input/chips/chips.styles.js +1 -2
  85. package/components/input/chips/chips.styles.js.map +1 -1
  86. package/components/input/currency/currency.component.js +1 -0
  87. package/components/input/currency/currency.component.js.map +1 -1
  88. package/components/input/number/number.component.js +1 -0
  89. package/components/input/number/number.component.js.map +1 -1
  90. package/components/input/switch/switch.component.js +2 -16
  91. package/components/input/switch/switch.component.js.map +1 -1
  92. package/components/input/switch/switch.props.js +0 -1
  93. package/components/input/switch/switch.props.js.map +1 -1
  94. package/components/input/switch/switch.styles.js +0 -19
  95. package/components/input/switch/switch.styles.js.map +1 -1
  96. package/components/input/text/text.component.js +14 -3
  97. package/components/input/text/text.component.js.map +1 -1
  98. package/components/input/text/text.props.js +1 -0
  99. package/components/input/text/text.props.js.map +1 -1
  100. package/components/input/text/text.styles.js +3 -1
  101. package/components/input/text/text.styles.js.map +1 -1
  102. package/components/input/textarea/textarea.component.js +3 -2
  103. package/components/input/textarea/textarea.component.js.map +1 -1
  104. package/components/input/toggle/toggle.component.js +4 -13
  105. package/components/input/toggle/toggle.component.js.map +1 -1
  106. package/components/input/toggle/toggle.props.js +1 -3
  107. package/components/input/toggle/toggle.props.js.map +1 -1
  108. package/components/input/toggle/toggle.styles.js +4 -12
  109. package/components/input/toggle/toggle.styles.js.map +1 -1
  110. package/components/navigation/appnavbar/appnavbar.props.js +1 -1
  111. package/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
  112. package/components/page/page-content/page-content.component.js +3 -0
  113. package/components/page/page-content/page-content.component.js.map +1 -1
  114. package/components/page/page-content/page-content.props.js +2 -0
  115. package/components/page/page-content/page-content.props.js.map +1 -1
  116. package/components/page/page.component.js +95 -2
  117. package/components/page/page.component.js.map +1 -1
  118. package/components/page/page.props.js +3 -0
  119. package/components/page/page.props.js.map +1 -1
  120. package/components/page/tabbar/tabbar.component.js +3 -2
  121. package/components/page/tabbar/tabbar.component.js.map +1 -1
  122. package/components/page/tabbar/tabbar.props.js +1 -0
  123. package/components/page/tabbar/tabbar.props.js.map +1 -1
  124. package/components-prism/basic/search/search.component.js +8 -12
  125. package/components-prism/basic/search/search.component.js.map +1 -1
  126. package/components-prism/basic/search/search.props.js +1 -1
  127. package/components-prism/basic/search/search.props.js.map +1 -1
  128. package/components-prism/basic/search/search.styles.js +60 -25
  129. package/components-prism/basic/search/search.styles.js.map +1 -1
  130. package/core/AppConfig.js.map +1 -1
  131. package/core/accessibility.js +9 -0
  132. package/core/accessibility.js.map +1 -1
  133. package/core/auto-layout-host.component.js +8 -2
  134. package/core/auto-layout-host.component.js.map +1 -1
  135. package/core/auto-layout.utils.js +59 -0
  136. package/core/auto-layout.utils.js.map +1 -1
  137. package/core/base.component.js +22 -1
  138. package/core/base.component.js.map +1 -1
  139. package/core/components/floatinglabel.component.js +5 -2
  140. package/core/components/floatinglabel.component.js.map +1 -1
  141. package/core/components/textinput.component.js +3 -0
  142. package/core/components/textinput.component.js.map +1 -1
  143. package/core/network.service.js.map +1 -1
  144. package/core/tappable.component.js +109 -15
  145. package/core/tappable.component.js.map +1 -1
  146. package/npm-shrinkwrap.json +2835 -5858
  147. package/package-lock.json +2835 -5858
  148. package/package.json +25 -18
  149. package/runtime/base-fragment.component.js +7 -1
  150. package/runtime/base-fragment.component.js.map +1 -1
  151. package/runtime/base-page.component.js +24 -0
  152. package/runtime/base-page.component.js.map +1 -1
  153. package/runtime/base-partial.component.js.map +1 -1
  154. package/runtime/navigator/drawer.navigator.js +1 -0
  155. package/runtime/navigator/drawer.navigator.js.map +1 -1
  156. package/runtime/navigator/stack.navigator.js +16 -1
  157. package/runtime/navigator/stack.navigator.js.map +1 -1
  158. package/runtime/services/device/scan-service.js +12 -34
  159. package/runtime/services/device/scan-service.js.map +1 -1
  160. package/styles/theme.variables.js.map +1 -1
  161. package/variables/http.service.js +6 -1
  162. package/variables/http.service.js.map +1 -1
  163. package/variables/interceptor/intercept-context.impl.js +46 -0
  164. package/variables/interceptor/intercept-context.impl.js.map +1 -0
  165. package/variables/interceptor/interceptor.factory.js +78 -0
  166. package/variables/interceptor/interceptor.factory.js.map +1 -0
  167. package/variables/interceptor/persistent.storage.js +142 -0
  168. package/variables/interceptor/persistent.storage.js.map +1 -0
  169. package/variables/interceptor/service-variable-interceptor.js +52 -0
  170. package/variables/interceptor/service-variable-interceptor.js.map +1 -0
  171. package/variables/service-variable.js +109 -1
  172. package/variables/service-variable.js.map +1 -1
@@ -0,0 +1,68 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import React from 'react';
3
+ import { View } from 'react-native';
4
+ import WmPicture from '@wavemaker-ai/app-rn-runtime/components/basic/picture/picture.component';
5
+ import WmLabel from '@wavemaker-ai/app-rn-runtime/components/basic/label/label.component';
6
+ import injector from '@wavemaker-ai/app-rn-runtime/core/injector';
7
+ import WmButton from '@wavemaker-ai/app-rn-runtime/components/basic/button/button.component';
8
+ import { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';
9
+ import WmOfflineBannerProps from './offline-banner.props';
10
+ import { DEFAULT_CLASS } from './offline-banner.styles';
11
+ import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
12
+ import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';
13
+ class WMOfflineBannerState extends BaseComponentState {}
14
+ class OfflineBanner extends BaseComponent {
15
+ constructor(props) {
16
+ super(props, DEFAULT_CLASS, new WmOfflineBannerProps(), new WMOfflineBannerState());
17
+ }
18
+ renderWidget(props) {
19
+ var _appConfig$appLocale;
20
+ const appConfig = injector.get('APP_CONFIG');
21
+ const appLocale = (appConfig === null || appConfig === void 0 || (_appConfig$appLocale = appConfig.appLocale) === null || _appConfig$appLocale === void 0 ? void 0 : _appConfig$appLocale.messages) || {};
22
+ return /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, (insets = {
23
+ top: 0,
24
+ bottom: 0,
25
+ left: 0,
26
+ right: 0
27
+ }) => {
28
+ var _appConfig$preference, _appConfig$preference2, _appConfig$preference3, _appConfig$preference4;
29
+ return /*#__PURE__*/React.createElement(View, _extends({
30
+ style: [{
31
+ paddingTop: insets === null || insets === void 0 ? void 0 : insets.top,
32
+ paddingBottom: insets === null || insets === void 0 ? void 0 : insets.bottom
33
+ }, this.styles.root]
34
+ }, getAccessibilityProps(AccessibilityWidgetType.OFFLINE_BANNER, {
35
+ accessibilitylabel: 'You are currently offline',
36
+ hint: 'Connection status notification'
37
+ })), /*#__PURE__*/React.createElement(View, {
38
+ style: this.styles.infoContainer
39
+ }, /*#__PURE__*/React.createElement(View, {
40
+ style: this.styles.imageContainer
41
+ }, /*#__PURE__*/React.createElement(WmPicture, {
42
+ picturesource: appConfig === null || appConfig === void 0 || (_appConfig$preference = appConfig.preferences) === null || _appConfig$preference === void 0 ? void 0 : _appConfig$preference.offlineImage,
43
+ resizemode: "contain",
44
+ name: "offline_picture",
45
+ classname: "offline-banner-image"
46
+ })), /*#__PURE__*/React.createElement(View, {
47
+ style: this.styles.textContainer
48
+ }, /*#__PURE__*/React.createElement(WmLabel, {
49
+ caption: appLocale.LABEL_OFFLINE_TITLE || (appConfig === null || appConfig === void 0 || (_appConfig$preference2 = appConfig.preferences) === null || _appConfig$preference2 === void 0 ? void 0 : _appConfig$preference2.offlineTitle) || 'No Internet connection',
50
+ classname: "offline-banner-message"
51
+ }), /*#__PURE__*/React.createElement(WmLabel, {
52
+ caption: appLocale.MESSAGE_OFFLINE_DESCRIPTION || (appConfig === null || appConfig === void 0 || (_appConfig$preference3 = appConfig.preferences) === null || _appConfig$preference3 === void 0 ? void 0 : _appConfig$preference3.offlineMessage) || 'You appear to be offline. Please check your internet connection.',
53
+ classname: "offline-banner-description"
54
+ }))), /*#__PURE__*/React.createElement(View, {
55
+ style: this.styles.buttonContainer
56
+ }, /*#__PURE__*/React.createElement(WmButton, {
57
+ caption: appLocale.LABEL_OFFLINE_RETRY || (appConfig === null || appConfig === void 0 || (_appConfig$preference4 = appConfig.preferences) === null || _appConfig$preference4 === void 0 ? void 0 : _appConfig$preference4.offlineRetry) || 'Try Again',
58
+ classname: "offline-banner-retry-button",
59
+ onTap: () => {
60
+ props.onRetry();
61
+ }
62
+ })));
63
+ });
64
+ }
65
+ }
66
+ ;
67
+ export default OfflineBanner;
68
+ //# sourceMappingURL=offline-banner.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","WmPicture","WmLabel","injector","WmButton","BaseComponent","BaseComponentState","WmOfflineBannerProps","DEFAULT_CLASS","SafeAreaInsetsContext","AccessibilityWidgetType","getAccessibilityProps","WMOfflineBannerState","OfflineBanner","constructor","props","renderWidget","_appConfig$appLocale","appConfig","get","appLocale","messages","createElement","Consumer","insets","top","bottom","left","right","_appConfig$preference","_appConfig$preference2","_appConfig$preference3","_appConfig$preference4","_extends","style","paddingTop","paddingBottom","styles","root","OFFLINE_BANNER","accessibilitylabel","hint","infoContainer","imageContainer","picturesource","preferences","offlineImage","resizemode","name","classname","textContainer","caption","LABEL_OFFLINE_TITLE","offlineTitle","MESSAGE_OFFLINE_DESCRIPTION","offlineMessage","buttonContainer","LABEL_OFFLINE_RETRY","offlineRetry","onTap","onRetry"],"sources":["offline-banner.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Alert, View } from 'react-native';\nimport WmPicture from '@wavemaker-ai/app-rn-runtime/components/basic/picture/picture.component';\nimport WmLabel from '@wavemaker-ai/app-rn-runtime/components/basic/label/label.component';\nimport AppConfig from '@wavemaker-ai/app-rn-runtime/core/AppConfig';\nimport injector from '@wavemaker-ai/app-rn-runtime/core/injector';\nimport WmButton from '@wavemaker-ai/app-rn-runtime/components/basic/button/button.component';\nimport { BaseComponent, BaseComponentState, BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport WmOfflineBannerProps from './offline-banner.props';\nimport { DEFAULT_CLASS, WmOfflineBannerStyles } from './offline-banner.styles';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\n\nclass WMOfflineBannerState extends BaseComponentState<WmOfflineBannerProps> {}\n\nclass OfflineBanner extends BaseComponent<WmOfflineBannerProps, WMOfflineBannerState, WmOfflineBannerStyles> {\n constructor(props: WmOfflineBannerProps) {\n super(props, DEFAULT_CLASS, new WmOfflineBannerProps(), new WMOfflineBannerState());\n }\n\n renderWidget(props: WmOfflineBannerProps) {\n\n const appConfig = injector.get<AppConfig>('APP_CONFIG');\n const appLocale = appConfig?.appLocale?.messages || {};\n\n return <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n return (\n <View\n style={[\n { paddingTop: insets?.top, paddingBottom: insets?.bottom },\n this.styles.root,\n ]}\n {...getAccessibilityProps(AccessibilityWidgetType.OFFLINE_BANNER, {\n accessibilitylabel: 'You are currently offline',\n hint: 'Connection status notification'\n })}\n >\n <View style={this.styles.infoContainer}>\n\n <View style={this.styles.imageContainer}>\n <WmPicture\n picturesource={appConfig?.preferences?.offlineImage}\n resizemode=\"contain\"\n name=\"offline_picture\"\n classname='offline-banner-image'\n />\n </View>\n <View style={this.styles.textContainer}>\n <WmLabel\n caption={appLocale.LABEL_OFFLINE_TITLE || appConfig?.preferences?.offlineTitle || 'No Internet connection'}\n classname='offline-banner-message'\n />\n <WmLabel\n caption={appLocale.MESSAGE_OFFLINE_DESCRIPTION || appConfig?.preferences?.offlineMessage || 'You appear to be offline. Please check your internet connection.'}\n classname='offline-banner-description'\n />\n </View>\n </View>\n <View style={this.styles.buttonContainer}>\n <WmButton\n caption={appLocale.LABEL_OFFLINE_RETRY || appConfig?.preferences?.offlineRetry || 'Try Again'}\n classname={\"offline-banner-retry-button\"}\n onTap={() => {\n props.onRetry();\n }}\n />\n </View>\n </View> )\n }}\n </SafeAreaInsetsContext.Consumer>\n }\n};\n\nexport default OfflineBanner;"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAiBC,IAAI,QAAQ,cAAc;AAC3C,OAAOC,SAAS,MAAM,yEAAyE;AAC/F,OAAOC,OAAO,MAAM,qEAAqE;AAEzF,OAAOC,QAAQ,MAAM,4CAA4C;AACjE,OAAOC,QAAQ,MAAM,uEAAuE;AAC5F,SAASC,aAAa,EAAEC,kBAAkB,QAAmB,kDAAkD;AAC/G,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,SAASC,aAAa,QAA+B,yBAAyB;AAC9E,SAAUC,qBAAqB,QAAQ,gCAAgC;AACvE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAEhH,MAAMC,oBAAoB,SAASN,kBAAkB,CAAuB;AAE5E,M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B,YAAY,KAAI,WAAY;QAChGT,SAAS,EAAE,6BAA8B;QACzCU,KAAK,EAAEA,CAAA,KAAM;UACX5C,KAAK,CAAC6C,OAAO,CAAC,CAAC;QAChB;MAAE,CACH,CACK,CACA,CAAC;IACR,CACgC,CAAC;EACnC;AACF;AAAC;AAED,eAAe/C,aAAa","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';
5
+ export default class WmOfflineBannerProps extends BaseProps {
6
+ constructor(...args) {
7
+ super(...args);
8
+ _defineProperty(this, "onRetry", null);
9
+ _defineProperty(this, "message", 'No Internet Connection');
10
+ }
11
+ }
12
+ //# sourceMappingURL=offline-banner.props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BaseProps","WmOfflineBannerProps","constructor","args","_defineProperty"],"sources":["offline-banner.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nexport default class WmOfflineBannerProps extends BaseProps {\n onRetry: () => void = null as any;\n message?: string = 'No Internet Connection';\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAE5E,eAAe,MAAMC,oBAAoB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBACpC,IAAI;IAAAA,eAAA,kBACP,wBAAwB;EAAA;AAC7C","ignoreList":[]}
@@ -0,0 +1,99 @@
1
+ import BASE_THEME from '@wavemaker-ai/app-rn-runtime/styles/theme';
2
+ import { defineStyles } from '@wavemaker-ai/app-rn-runtime/core/base.component';
3
+ export const DEFAULT_CLASS = 'app-offline-banner';
4
+ BASE_THEME.registerStyle((themeVariables, addStyle) => {
5
+ const defaultStyles = defineStyles({
6
+ root: {
7
+ flex: 1,
8
+ paddingHorizontal: 20,
9
+ backgroundColor: '#fff',
10
+ justifyContent: 'center'
11
+ },
12
+ textContainer: {},
13
+ text: {},
14
+ infoContainer: {
15
+ flex: 1,
16
+ width: '100%',
17
+ justifyContent: 'center'
18
+ },
19
+ imageContainer: {
20
+ alignItems: 'center',
21
+ marginVertical: 24
22
+ },
23
+ errorImage: {
24
+ width: '80%',
25
+ maxWidth: 150,
26
+ height: undefined,
27
+ aspectRatio: 1.2,
28
+ maxHeight: 150,
29
+ alignSelf: 'center'
30
+ },
31
+ title: {
32
+ fontSize: 24,
33
+ fontWeight: '700',
34
+ textAlign: 'center',
35
+ color: '#2d3748',
36
+ marginBottom: 8
37
+ },
38
+ subtitle: {
39
+ fontSize: 14,
40
+ textAlign: 'center',
41
+ color: '#71717A',
42
+ marginBottom: 24,
43
+ fontWeight: '400'
44
+ },
45
+ buttonContainer: {
46
+ width: '100%',
47
+ maxWidth: 400,
48
+ alignSelf: 'center',
49
+ marginTop: 24,
50
+ marginBottom: 16
51
+ }
52
+ });
53
+ addStyle(DEFAULT_CLASS, '', defaultStyles);
54
+ addStyle('offline-banner-image', '', {
55
+ root: {
56
+ width: '80%',
57
+ maxWidth: 150,
58
+ height: undefined,
59
+ aspectRatio: 1.2,
60
+ maxHeight: 150,
61
+ alignSelf: 'center'
62
+ }
63
+ });
64
+ addStyle('offline-banner-message', '', {
65
+ root: {
66
+ alignSelf: 'center'
67
+ },
68
+ text: defaultStyles.title
69
+ });
70
+ addStyle('offline-banner-description', '', {
71
+ root: {
72
+ alignSelf: 'center'
73
+ },
74
+ text: defaultStyles.subtitle
75
+ });
76
+ addStyle('offline-banner-retry-button', '', {
77
+ root: {
78
+ backgroundColor: themeVariables.buttonPrimaryColor,
79
+ borderRadius: 12,
80
+ paddingVertical: 16,
81
+ paddingHorizontal: 24,
82
+ alignItems: 'center',
83
+ alignSelf: 'center',
84
+ width: '100%'
85
+ },
86
+ text: {
87
+ color: '#ffffff',
88
+ fontWeight: '700',
89
+ fontSize: 16,
90
+ lineHeight: 24,
91
+ textAlign: 'center'
92
+ },
93
+ badge: {
94
+ backgroundColor: '#ffffff',
95
+ color: '#3498db'
96
+ }
97
+ });
98
+ });
99
+ //# sourceMappingURL=offline-banner.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flex","paddingHorizontal","backgroundColor","justifyContent","textContainer","text","infoContainer","width","imageContainer","alignItems","marginVertical","errorImage","maxWidth","height","undefined","aspectRatio","maxHeight","alignSelf","title","fontSize","fontWeight","textAlign","color","marginBottom","subtitle","buttonContainer","marginTop","buttonPrimaryColor","borderRadius","paddingVertical","lineHeight","badge"],"sources":["offline-banner.styles.ts"],"sourcesContent":["import { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\nimport BASE_THEME, { AllStyle } from '@wavemaker-ai/app-rn-runtime/styles/theme';\nimport {\n BaseStyles,\n defineStyles,\n} from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { WmLabelStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/label/label.styles';\nimport { WmButtonStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/button/button.styles';\n\nexport type WmOfflineBannerStyles = BaseStyles & {\n imageContainer: AllStyle;\n textContainer: AllStyle;\n infoContainer: AllStyle;\n errorImage: AllStyle;\n title: AllStyle;\n subtitle: AllStyle;\n buttonContainer: AllStyle;\n};\n\nexport const DEFAULT_CLASS = 'app-offline-banner';\n\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmOfflineBannerStyles = defineStyles({\n root: {\n flex: 1,\n paddingHorizontal: 20,\n backgroundColor: '#fff',\n justifyContent: 'center',\n },\n textContainer: {\n },\n text: {},\n infoContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center',\n },\n imageContainer: {\n alignItems: 'center',\n marginVertical: 24,\n },\n errorImage: {\n width: '80%',\n maxWidth: 150,\n height: undefined,\n aspectRatio: 1.2,\n maxHeight: 150,\n alignSelf: 'center',\n },\n title: {\n fontSize: 24,\n fontWeight: '700',\n textAlign: 'center',\n color: '#2d3748',\n marginBottom: 8,\n },\n subtitle: {\n fontSize: 14,\n textAlign: 'center',\n color: '#71717A',\n marginBottom: 24,\n fontWeight: '400',\n },\n buttonContainer: {\n width: '100%',\n maxWidth: 400,\n alignSelf: 'center',\n marginTop: 24,\n marginBottom: 16,\n },\n })\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n\n addStyle('offline-banner-image', '', {\n root: {\n width: '80%',\n maxWidth: 150,\n height: undefined,\n aspectRatio: 1.2,\n maxHeight: 150,\n alignSelf: 'center', \n } as any\n });\n\n addStyle('offline-banner-message', '', {\n root: { alignSelf: 'center' },\n text: defaultStyles.title,\n } as WmLabelStyles);\n\n addStyle('offline-banner-description', '', {\n root: { alignSelf: 'center' },\n text: defaultStyles.subtitle,\n } as WmLabelStyles);\n\n addStyle('offline-banner-retry-button', '', {\n root: {\n backgroundColor: themeVariables.buttonPrimaryColor,\n borderRadius: 12,\n paddingVertical: 16,\n paddingHorizontal: 24,\n alignItems: 'center',\n alignSelf: 'center',\n width: '100%',\n },\n text: {\n color: '#ffffff',\n fontWeight: '700',\n fontSize: 16,\n lineHeight: 24,\n textAlign: 'center',\n },\n badge: {\n backgroundColor: '#ffffff',\n color: '#3498db',\n }\n });\n\n});\n\n\n"],"mappings":"AACA,OAAOA,UAAU,MAAoB,2CAA2C;AAChF,SAEEC,YAAY,QACP,kDAAkD;AAczD,OAAO,MAAMC,aAAa,GAAG,oBAAoB;AAE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AAE,KAAK;MACZK,QAAQ,EAAE,GAAG;MACbC,MAAM,EAAEC,SAAS;MACjBC,WAAW,EAAE,GAAG;MAChBC,SAAS,EAAE,GAAG;MACdC,SAAS,EAAE;IACb;EACF,CAAC,CAAC;EAEFpB,QAAQ,CAAC,wBAAwB,EAAE,EAAE,EAAE;IACrCE,IAAI,EAAE;MAAEkB,SAAS,EAAE;IAAS,CAAC;IAC7BZ,IAAI,EAAEP,aAAa,CAACoB;EACtB,CAAkB,CAAC;EAEnBrB,QAAQ,CAAC,4BAA4B,EAAE,EAAE,EAAE;IACzCE,IAAI,EAAE;MAAEkB,SAAS,EAAE;IAAS,CAAC;IAC7BZ,IAAI,EAAEP,aAAa,CAAC0B;EACtB,CAAkB,CAAC;EAEnB3B,QAAQ,CAAC,6BAA6B,EAAE,EAAE,EAAE;IAC1CE,IAAI,EAAE;MACJG,eAAe,EAAEN,cAAc,CAAC+B,kBAAkB;MAClDC,YAAY,EAAE,EAAE;MAChBC,eAAe,EAAE,EAAE;MACnB5B,iBAAiB,EAAE,EAAE;MACrBQ,UAAU,EAAE,QAAQ;MACpBQ,SAAS,EAAE,QAAQ;MACnBV,KAAK,EAAE;IACT,CAAC;IACDF,IAAI,EAAE;MACJiB,KAAK,EAAE,SAAS;MAChBF,UAAU,EAAE,KAAK;MACjBD,QAAQ,EAAE,EAAE;MACZW,UAAU,EAAE,EAAE;MACdT,SAAS,EAAE;IACb,CAAC;IACDU,KAAK,EAAE;MACL7B,eAAe,EAAE,SAAS;MAC1BoB,KAAK,EAAE;IACT;EACF,CAAC,CAAC;AAEJ,CAAC,CAAC","ignoreList":[]}
@@ -139,9 +139,9 @@ export default class WmWebview extends BaseComponent {
139
139
  containerStyle: this.styles.webview
140
140
  // style={this.styles.webview} // when using style, there are some inconsistencies observed in Android. containerStyle gives us a uniformity in IOS and Android.
141
141
  ,
142
- source: {
142
+ source: props.src ? {
143
143
  uri: props.src
144
- },
144
+ } : undefined,
145
145
  testID: this.getTestId('web_view')
146
146
  }, getAccessibilityProps(AccessibilityWidgetType.WEBVIEW, props), {
147
147
  incognito: props.incognito,
@@ -1 +1 @@
1
- {"version":3,"names":["React","BackHandler","Platform","View","WebView","HideMode","BaseComponent","BaseComponentState","WmWebviewProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","isAndroid","isWebPreviewMode","WmWebViewState","constructor","args","_defineProperty","title","src","WmWebview","props","webview","webViewState","canGoBack","goBack","event","_event$nativeEvent","data","nativeEvent","startsWith","id","match","callback","invokeJSCallbacks","result","substring","indexOf","parseResult","invokeEventCallback","hideMode","DONOT_ADD_TO_DOM","backHandlerSubscription","addEventListener","handleBackButtonPress","componentWillUnmount","remove","_this$state$currentTa","state","currentTarget","currentsrc","_this$state$currentTa2","executeScript","fn","Promise","resolve","reject","Date","now","injectJavaScript","insertCSS","style","replace","JSON","parse","e","getTitle","iframe","contentWindow","document","onLoad","updateState","renderWidget","createElement","styles","root","onLayout","handleLayout","_background","OS","width","height","_extends","ref","nestedScrollEnabled","containerStyle","source","uri","testID","getTestId","WEBVIEW","incognito","onMessage","sharedCookiesEnabled","onNavigationStateChange","scrollEnabled","onLoadEnd","url","allowsFullscreenVideo","allowsInlineMediaPlayback"],"sources":["webview.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BackHandler, Platform, View, NativeEventSubscription } from 'react-native';\nimport { WebView, WebViewNavigation, WebViewMessageEvent } from 'react-native-webview';\nimport { HideMode } from '@wavemaker-ai/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nimport WmWebviewProps from './webview.props';\nimport { DEFAULT_CLASS, WebviewStyles } from './webview.styles';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { isAndroid, isWebPreviewMode } from '@wavemaker-ai/app-rn-runtime/core/utils';\n\nclass WmWebViewState extends BaseComponentState<WmWebviewProps> {\n currentTarget = {\n title: '',\n src: ''\n };\n\n}\n\nexport default class WmWebview extends BaseComponent<WmWebviewProps, WmWebViewState, WebviewStyles> {\n\n private webview: WebView | null = null as any;\n private webViewState: WebViewNavigation = null as any;\n private invokeJSCallbacks = {} as any;\n private backHandlerSubscription: NativeEventSubscription | null = null;\n\n constructor(props: WmWebviewProps) {\n super(props, DEFAULT_CLASS, new WmWebviewProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n if (isAndroid() && !isWebPreviewMode()) {\n this.backHandlerSubscription = BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n if (this.backHandlerSubscription) {\n this.backHandlerSubscription.remove();\n this.backHandlerSubscription = null;\n }\n }\n\n handleBackButtonPress = (): boolean => {\n if (this.webview && this.webViewState && this.webViewState.canGoBack) {\n this.webview.goBack();\n return true;\n }\n return false;\n }\n\n get title() {\n return this.state.currentTarget?.title;\n }\n\n get currentsrc() {\n return this.state.currentTarget?.src;\n }\n\n executeScript(fn: string) {\n return new Promise((resolve, reject) => {\n if (this.webview) {\n const id = '' + Date.now();\n this.invokeJSCallbacks[id] = resolve;\n fn = `\n (function(){\n try{\n return (${fn});\n } catch(e) {\n return e.getMessage();\n }\n }())\n `;\n this.webview.injectJavaScript(\n `window.ReactNativeWebView.postMessage('afterInjectJavaScript:' + ${id} + ':' + JSON.stringify(${fn}))`\n );\n } else {\n reject();\n }\n });\n }\n\n insertCSS(style = '') {\n style = style.replace(/[\\n\\t\\r]/g, '');\n return this.executeScript(`\n function() {\n const style = document.createElement('style');\n style.innerHTML = '${style}';\n document.head.appendChild(style);\n return 'SUCCESS';\n }()\n `);\n }\n\n parseResult(result: string) {\n try {\n return JSON.parse(result);\n } catch(e) {\n if (result === 'undefined' || result === 'null') {\n return null;\n }\n return result;\n }\n }\n\n onMessage = (event: WebViewMessageEvent) => {\n const data: string = event.nativeEvent?.data;\n if (data && data.startsWith('afterInjectJavaScript')) {\n const id = data?.match(/\\:([0-9]+)\\:/);\n const callback = id && this.invokeJSCallbacks[id[1]];\n const result = data.substring(data.indexOf(':', data.indexOf(':') + 1) + 1);\n callback && callback(this.parseResult(result));\n } else {\n this.invokeEventCallback('onMessage', [event, this]);\n }\n }\n\n getTitle(iframe: any) {\n try {\n return iframe.currentTarget.contentWindow.document.title;\n } catch(e) {\n // browser blocks cross origin access to iframe content.\n }\n }\n\n public onLoad(e: any, title: string, src: string) {\n this.updateState({\n currentTarget: {\n title: title,\n src: src\n }\n } as WmWebViewState, () => {\n this.invokeEventCallback('onLoad', [e, this]);\n });\n }\n\n protected renderWidget(props: WmWebviewProps) {\n return (\n <View\n style={this.styles.root}\n onLayout={(event) => this.handleLayout(event)}\n >\n {this._background}\n {Platform.OS === 'web' ?\n (<iframe src={props.src} width={'100%'} height={'100%'}\n onLoad={(e) => this.onLoad(e, this.getTitle(e.currentTarget), (e.currentTarget as any).src)}></iframe>) :\n (<WebView\n ref={(ref) => this.webview = ref}\n nestedScrollEnabled={true}\n containerStyle = {this.styles.webview}\n // style={this.styles.webview} // when using style, there are some inconsistencies observed in Android. containerStyle gives us a uniformity in IOS and Android.\n source={{\n uri: props.src\n }}\n testID={this.getTestId('web_view')}\n {...getAccessibilityProps(AccessibilityWidgetType.WEBVIEW, props)}\n incognito={props.incognito}\n onMessage={this.onMessage}\n sharedCookiesEnabled={true}\n onNavigationStateChange={(state) => {\n this.webViewState = state;\n }}\n scrollEnabled={true}\n onLoadEnd={(e) => this.onLoad(e, e.nativeEvent.title, e.nativeEvent.url)}\n allowsFullscreenVideo={true}\n allowsInlineMediaPlayback={true}\n >\n </WebView>)}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,QAAiC,cAAc;AACnF,SAASC,OAAO,QAAgD,sBAAsB;AACtF,SAASC,QAAQ,QAAQ,gDAAgD;AACzE,SAASC,aAAa,EAAEC,kBAAkB,QA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;MAC3BC,uBAAuB,EAAG9C,KAAK,IAAK;QAClC,IAAI,CAACzB,YAAY,GAAGyB,KAAK;MAC3B,CAAE;MACF+C,aAAa,EAAE,IAAK;MACpBC,SAAS,EAAG/B,CAAC,IAAK,IAAI,CAACK,MAAM,CAACL,CAAC,EAAEA,CAAC,CAACpC,WAAW,CAACX,KAAK,EAAE+C,CAAC,CAACpC,WAAW,CAACoE,GAAG,CAAE;MACzEC,qBAAqB,EAAE,IAAK;MAC5BC,yBAAyB,EAAE;IAAK,EAEzB,CACP,CAAC;EAEX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","BackHandler","Platform","View","WebView","HideMode","BaseComponent","BaseComponentState","WmWebviewProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","isAndroid","isWebPreviewMode","WmWebViewState","constructor","args","_defineProperty","title","src","WmWebview","props","webview","webViewState","canGoBack","goBack","event","_event$nativeEvent","data","nativeEvent","startsWith","id","match","callback","invokeJSCallbacks","result","substring","indexOf","parseResult","invokeEventCallback","hideMode","DONOT_ADD_TO_DOM","backHandlerSubscription","addEventListener","handleBackButtonPress","componentWillUnmount","remove","_this$state$currentTa","state","currentTarget","currentsrc","_this$state$currentTa2","executeScript","fn","Promise","resolve","reject","Date","now","injectJavaScript","insertCSS","style","replace","JSON","parse","e","getTitle","iframe","contentWindow","document","onLoad","updateState","renderWidget","createElement","styles","root","onLayout","handleLayout","_background","OS","width","height","_extends","ref","nestedScrollEnabled","containerStyle","source","uri","undefined","testID","getTestId","WEBVIEW","incognito","onMessage","sharedCookiesEnabled","onNavigationStateChange","scrollEnabled","onLoadEnd","url","allowsFullscreenVideo","allowsInlineMediaPlayback"],"sources":["webview.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BackHandler, Platform, View, NativeEventSubscription } from 'react-native';\nimport { WebView, WebViewNavigation, WebViewMessageEvent } from 'react-native-webview';\nimport { HideMode } from '@wavemaker-ai/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nimport WmWebviewProps from './webview.props';\nimport { DEFAULT_CLASS, WebviewStyles } from './webview.styles';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { isAndroid, isWebPreviewMode } from '@wavemaker-ai/app-rn-runtime/core/utils';\n\nclass WmWebViewState extends BaseComponentState<WmWebviewProps> {\n currentTarget = {\n title: '',\n src: ''\n };\n\n}\n\nexport default class WmWebview extends BaseComponent<WmWebviewProps, WmWebViewState, WebviewStyles> {\n\n private webview: WebView | null = null as any;\n private webViewState: WebViewNavigation = null as any;\n private invokeJSCallbacks = {} as any;\n private backHandlerSubscription: NativeEventSubscription | null = null;\n\n constructor(props: WmWebviewProps) {\n super(props, DEFAULT_CLASS, new WmWebviewProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n if (isAndroid() && !isWebPreviewMode()) {\n this.backHandlerSubscription = BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n if (this.backHandlerSubscription) {\n this.backHandlerSubscription.remove();\n this.backHandlerSubscription = null;\n }\n }\n\n handleBackButtonPress = (): boolean => {\n if (this.webview && this.webViewState && this.webViewState.canGoBack) {\n this.webview.goBack();\n return true;\n }\n return false;\n }\n\n get title() {\n return this.state.currentTarget?.title;\n }\n\n get currentsrc() {\n return this.state.currentTarget?.src;\n }\n\n executeScript(fn: string) {\n return new Promise((resolve, reject) => {\n if (this.webview) {\n const id = '' + Date.now();\n this.invokeJSCallbacks[id] = resolve;\n fn = `\n (function(){\n try{\n return (${fn});\n } catch(e) {\n return e.getMessage();\n }\n }())\n `;\n this.webview.injectJavaScript(\n `window.ReactNativeWebView.postMessage('afterInjectJavaScript:' + ${id} + ':' + JSON.stringify(${fn}))`\n );\n } else {\n reject();\n }\n });\n }\n\n insertCSS(style = '') {\n style = style.replace(/[\\n\\t\\r]/g, '');\n return this.executeScript(`\n function() {\n const style = document.createElement('style');\n style.innerHTML = '${style}';\n document.head.appendChild(style);\n return 'SUCCESS';\n }()\n `);\n }\n\n parseResult(result: string) {\n try {\n return JSON.parse(result);\n } catch(e) {\n if (result === 'undefined' || result === 'null') {\n return null;\n }\n return result;\n }\n }\n\n onMessage = (event: WebViewMessageEvent) => {\n const data: string = event.nativeEvent?.data;\n if (data && data.startsWith('afterInjectJavaScript')) {\n const id = data?.match(/\\:([0-9]+)\\:/);\n const callback = id && this.invokeJSCallbacks[id[1]];\n const result = data.substring(data.indexOf(':', data.indexOf(':') + 1) + 1);\n callback && callback(this.parseResult(result));\n } else {\n this.invokeEventCallback('onMessage', [event, this]);\n }\n }\n\n getTitle(iframe: any) {\n try {\n return iframe.currentTarget.contentWindow.document.title;\n } catch(e) {\n // browser blocks cross origin access to iframe content.\n }\n }\n\n public onLoad(e: any, title: string, src: string) {\n this.updateState({\n currentTarget: {\n title: title,\n src: src\n }\n } as WmWebViewState, () => {\n this.invokeEventCallback('onLoad', [e, this]);\n });\n }\n\n protected renderWidget(props: WmWebviewProps) {\n return (\n <View\n style={this.styles.root}\n onLayout={(event) => this.handleLayout(event)}\n >\n {this._background}\n {Platform.OS === 'web' ?\n (<iframe src={props.src} width={'100%'} height={'100%'}\n onLoad={(e) => this.onLoad(e, this.getTitle(e.currentTarget), (e.currentTarget as any).src)}></iframe>) :\n (<WebView\n ref={(ref) => this.webview = ref}\n nestedScrollEnabled={true}\n containerStyle = {this.styles.webview}\n // style={this.styles.webview} // when using style, there are some inconsistencies observed in Android. containerStyle gives us a uniformity in IOS and Android.\n source={props.src ? { uri: props.src } : undefined}\n testID={this.getTestId('web_view')}\n {...getAccessibilityProps(AccessibilityWidgetType.WEBVIEW, props)}\n incognito={props.incognito}\n onMessage={this.onMessage}\n sharedCookiesEnabled={true}\n onNavigationStateChange={(state) => {\n this.webViewState = state;\n }}\n scrollEnabled={true}\n onLoadEnd={(e) => this.onLoad(e, e.nativeEvent.title, e.nativ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A;MACAgE,MAAM,EAAEjE,KAAK,CAACF,GAAG,GAAG;QAAEoE,GAAG,EAAElE,KAAK,CAACF;MAAI,CAAC,GAAGqE,SAAU;MACnDC,MAAM,EAAE,IAAI,CAACC,SAAS,CAAC,UAAU;IAAE,GAC/B/E,qBAAqB,CAACD,uBAAuB,CAACiF,OAAO,EAAEtE,KAAK,CAAC;MACjEuE,SAAS,EAAEvE,KAAK,CAACuE,SAAU;MAC3BC,SAAS,EAAE,IAAI,CAACA,SAAU;MAC1BC,oBAAoB,EAAE,IAAK;MAC3BC,uBAAuB,EAAG/C,KAAK,IAAK;QAClC,IAAI,CAACzB,YAAY,GAAGyB,KAAK;MAC3B,CAAE;MACFgD,aAAa,EAAE,IAAK;MACpBC,SAAS,EAAGhC,CAAC,IAAK,IAAI,CAACK,MAAM,CAACL,CAAC,EAAEA,CAAC,CAACpC,WAAW,CAACX,KAAK,EAAE+C,CAAC,CAACpC,WAAW,CAACqE,GAAG,CAAE;MACzEC,qBAAqB,EAAE,IAAK;MAC5BC,yBAAyB,EAAE;IAAK,EAEzB,CACP,CAAC;EAEX;AACF","ignoreList":[]}
@@ -5,7 +5,7 @@ import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';
5
5
  export default class WmWebviewProps extends BaseProps {
6
6
  constructor(...args) {
7
7
  super(...args);
8
- _defineProperty(this, "src", null);
8
+ _defineProperty(this, "src", '');
9
9
  _defineProperty(this, "incognito", false);
10
10
  _defineProperty(this, "onLoad", null);
11
11
  _defineProperty(this, "accessibilitylabel", undefined);
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmWebviewProps","constructor","args","_defineProperty","undefined"],"sources":["webview.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport WmWebview from './webview.component';\nimport { AccessibilityRole } from 'react-native';\n\nexport default class WmWebviewProps extends BaseProps {\n src: string = null as any;\n incognito? = false;\n onLoad?: ($event: any, $widget: WmWebview) => void = null as any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAI5E,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,cACtC,IAAI;IAAAA,eAAA,oBACL,KAAK;IAAAA,eAAA,iBACmC,IAAI;IAAAA,eAAA,6BAC3BC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;EAAA;AAE3B","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","WmWebviewProps","constructor","args","_defineProperty","undefined"],"sources":["webview.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport WmWebview from './webview.component';\nimport { AccessibilityRole } from 'react-native';\n\nexport default class WmWebviewProps extends BaseProps {\n src: string = '';\n incognito? = false;\n onLoad?: ($event: any, $widget: WmWebview) => void = null as any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAI5E,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,cACtC,EAAE;IAAAA,eAAA,oBACH,KAAK;IAAAA,eAAA,iBACmC,IAAI;IAAAA,eAAA,6BAC3BC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;EAAA;AAE3B","ignoreList":[]}
@@ -5,8 +5,9 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
5
5
  import React, { createRef } from 'react';
6
6
  import { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';
7
7
  import { View, PanResponder, Dimensions, TouchableWithoutFeedback, Platform, StatusBar, BackHandler, KeyboardAvoidingView, Keyboard, Modal, Pressable } from 'react-native';
8
- import { ScrollView } from 'react-native-gesture-handler';
8
+ import { Gesture, GestureDetector, GestureHandlerRootView, ScrollView } from 'react-native-gesture-handler';
9
9
  import Animated, { useAnimatedStyle, withTiming, runOnJS, Easing, makeMutable, cancelAnimation } from 'react-native-reanimated';
10
+ import * as Animatable from 'react-native-animatable';
10
11
  import WmBottomsheetProps from './bottomsheet.props';
11
12
  import { DEFAULT_CLASS } from './bottomsheet.styles';
12
13
  import { createSkeleton } from '../skeleton/skeleton.component';
@@ -57,6 +58,8 @@ export class WmBottomsheetState extends BaseComponentState {
57
58
  _defineProperty(this, "keyboardHeight", 0);
58
59
  _defineProperty(this, "localModalsOpened", []);
59
60
  _defineProperty(this, "lastGestureDy", 0);
61
+ _defineProperty(this, "contentAnimationId", 0);
62
+ _defineProperty(this, "contentAnimatableProps", undefined);
60
63
  }
61
64
  }
62
65
 
@@ -74,8 +77,32 @@ const AnimatedBottomsheetContent = ({
74
77
  onBackdropPress,
75
78
  onDragHandlePress,
76
79
  getTestProps,
77
- enabledragsettle
80
+ enabledragsettle,
81
+ scrollRef,
82
+ containerScrollRef,
83
+ configurePanGesture
78
84
  }) => {
85
+ // Simple RNGH GestureDetector attached to the same view as the PanResponder (panHandlers).
86
+ // No thresholds/validation: logs translationY directly during pan.
87
+ const panGesture = React.useMemo(() => {
88
+ // Create base Pan gesture
89
+ const pan = Gesture.Pan().runOnJS(true);
90
+
91
+ // Add external gestures for ScrollViews (container widget scrollview)
92
+ if (scrollRef && containerScrollRef) {
93
+ pan.simultaneousWithExternalGesture(scrollRef, containerScrollRef);
94
+ } else if (scrollRef) {
95
+ pan.simultaneousWithExternalGesture(scrollRef);
96
+ } else if (containerScrollRef) {
97
+ pan.simultaneousWithExternalGesture(containerScrollRef);
98
+ }
99
+
100
+ // Apply custom logic from parent BottomSheet class
101
+ if (configurePanGesture) {
102
+ configurePanGesture(pan);
103
+ }
104
+ return pan;
105
+ }, [scrollRef, containerScrollRef, configurePanGesture]);
79
106
  const backdropAnimatedStyle = useAnimatedStyle(() => ({
80
107
  opacity: backdropOpacity.value
81
108
  }));
@@ -97,15 +124,18 @@ const AnimatedBottomsheetContent = ({
97
124
  onPress: onBackdropPress
98
125
  }, /*#__PURE__*/React.createElement(Animated.View, _extends({
99
126
  style: [styles.backdrop, backdropAnimatedStyle]
100
- }, getTestProps('backdrop'), getAccessibilityProps(AccessibilityWidgetType.BOTTOMSHEET, props)))), /*#__PURE__*/React.createElement(Animated.View, _extends({
127
+ }, getTestProps('backdrop'), getAccessibilityProps(AccessibilityWidgetType.BOTTOMSHEET, props)))), /*#__PURE__*/React.createElement(Animated.View, {
101
128
  style: [styles.container, containerAnimatedStyle]
102
- }, panHandlers), /*#__PURE__*/React.createElement(View, _extends({
129
+ // {...panHandlers}
130
+ }, /*#__PURE__*/React.createElement(View, _extends({
103
131
  style: styles.dragHandleContainer
104
132
  }, dragHandlePanHandlers), /*#__PURE__*/React.createElement(Pressable, {
105
133
  onPress: onDragHandlePress
106
134
  }, /*#__PURE__*/React.createElement(View, _extends({
107
135
  style: styles.dragIconHandle
108
- }, getTestProps('draghandle'))))), children(contentStyle)));
136
+ }, getTestProps('draghandle'))))), /*#__PURE__*/React.createElement(GestureDetector, {
137
+ gesture: panGesture
138
+ }, children(contentStyle))));
109
139
  };
110
140
  export default class WmBottomsheet extends BaseComponent {
111
141
  // Helper method to calculate animation duration based on distance and velocity
@@ -146,6 +176,12 @@ export default class WmBottomsheet extends BaseComponent {
146
176
  this.closeSheet();
147
177
  }
148
178
  }
179
+ animate(props) {
180
+ this.updateState({
181
+ contentAnimationId: Date.now(),
182
+ contentAnimatableProps: props
183
+ });
184
+ }
149
185
  constructor(_props) {
150
186
  super(_props, DEFAULT_CLASS, new WmBottomsheetProps(), new WmBottomsheetState());
151
187
  _defineProperty(this, "calculatedHeight", void 0);
@@ -168,6 +204,9 @@ export default class WmBottomsheet extends BaseComponent {
168
204
  _defineProperty(this, "isIosKeyboardHeightSet", false);
169
205
  _defineProperty(this, "sheetModalService", void 0);
170
206
  _defineProperty(this, "isDragHandleExpanding", false);
207
+ //container widget scrollview ref and y offset value
208
+ _defineProperty(this, "containerscrollViewRef", null);
209
+ _defineProperty(this, "containerscrollYoffset", 0);
171
210
  // Reanimated shared values - created once and reused
172
211
  _defineProperty(this, "translateY", void 0);
173
212
  _defineProperty(this, "backdropOpacity", void 0);
@@ -322,6 +361,20 @@ export default class WmBottomsheet extends BaseComponent {
322
361
  if (this.state.isExpanded || this.props.disableswipedownclose) {
323
362
  if (gestureState.dy < this.expandedHeight / 4 || this.props.disableswipedownclose) {
324
363
  var _this$sheetHeight;
364
+ //reseting bottom sheet scrollview offset value to fix scrollview automatic scroll issue while collpsing the bottom sheet
365
+ setTimeout(() => {
366
+ var _this$state$scrollVie;
367
+ if ((_this$state$scrollVie = this.state.scrollViewRef) !== null && _this$state$scrollVie !== void 0 && _this$state$scrollVie.current) {
368
+ this.state.scrollViewRef.current.scrollTo({
369
+ x: 0,
370
+ y: 0,
371
+ animated: false
372
+ });
373
+ this.updateState({
374
+ scrollOffset: 0
375
+ });
376
+ }
377
+ }, this.animationDuration);
325
378
  let sheetMinimumHeight = this.props.bottomsheetminimumheight || 0.1;
326
379
  const targetHeight = this.props.disableswipedownclose ? sheetMinimumHeight * SCREEN_HEIGHT : this.calculatedHeight;
327
380
  const currentHeight = ((_this$sheetHeight = this.sheetHeight) === null || _this$sheetHeight === void 0 ? void 0 : _this$sheetHeight.value) || this.expandedHeight;
@@ -363,6 +416,47 @@ export default class WmBottomsheet extends BaseComponent {
363
416
  }
364
417
  }
365
418
  });
419
+ _defineProperty(this, "configurePanGesture", pan => {
420
+ pan.enabled(true).onUpdate(event => {
421
+ // ← Add : any
422
+ const gestureState = {
423
+ dy: event.translationY,
424
+ vy: event.velocityY,
425
+ moveX: event.x,
426
+ moveY: event.y,
427
+ vx: event.velocityX
428
+ };
429
+ if (gestureState.dy > 0 && this.translateY && this.lastGestureDyShared && this.state.scrollOffset <= 0 && this.containerscrollYoffset <= 0) {
430
+ const newTranslateY = Math.max(0, this.lastGestureDyShared.value + gestureState.dy);
431
+ this.translateY.value = newTranslateY;
432
+ // Reset expand flag if dragging down
433
+ this.isDragHandleExpanding = false;
434
+ } else if (gestureState.dy < 0 && this.props.expand && this.props.bottomsheetheightratio !== 1 && !this.isDragHandleExpanding && !this.state.isExpanded && this.props.disablescrollonrest) {
435
+ // Only trigger expand once with threshold of -50px upward drag
436
+ this.isDragHandleExpanding = true;
437
+ this.expandBottomSheet();
438
+ }
439
+ // ... rest of logic
440
+ }).onEnd(event => {
441
+ // ← Add : any
442
+ const gestureState = {
443
+ dy: event.translationY,
444
+ vy: event.velocityY,
445
+ moveX: event.x,
446
+ moveY: event.y,
447
+ vx: event.velocityX
448
+ };
449
+ if (gestureState.dy > 0 && this.state.scrollOffset <= 0 && this.containerscrollYoffset <= 0) {
450
+ this.handleSwipeGesture(gestureState);
451
+ }
452
+ }).onFinalize((event, success) => {
453
+ // ← Add types
454
+ if (!success) {
455
+ this.openSheet();
456
+ }
457
+ });
458
+ return pan;
459
+ });
366
460
  // panResponder for bottom sheet scroll view
367
461
  _defineProperty(this, "panResponder", PanResponder.create({
368
462
  onStartShouldSetPanResponder: (_, gestureState) => {
@@ -483,8 +577,12 @@ export default class WmBottomsheet extends BaseComponent {
483
577
  }
484
578
  this.updateState({
485
579
  isExpanded: false,
486
- localModalsOpened: []
580
+ localModalsOpened: [],
581
+ scrollOffset: 0,
582
+ contentAnimationId: 0,
583
+ contentAnimatableProps: undefined
487
584
  });
585
+ this.containerscrollYoffset = 0;
488
586
  this.handleClose();
489
587
  };
490
588
  if (this.translateY && this.backdropOpacity) {
@@ -513,7 +611,9 @@ export default class WmBottomsheet extends BaseComponent {
513
611
  lastGestureDy: 0,
514
612
  isExpanded: false,
515
613
  isBottomsheetVisible: false,
516
- localModalsOpened: []
614
+ localModalsOpened: [],
615
+ contentAnimationId: 0,
616
+ contentAnimatableProps: undefined
517
617
  });
518
618
  requestAnimationFrame(() => {
519
619
  if (this.sheetHeight) {
@@ -530,6 +630,14 @@ export default class WmBottomsheet extends BaseComponent {
530
630
  _defineProperty(this, "handleDragHandlePress", () => {
531
631
  this.invokeEventCallback('onDraghandleiconclick', [null, this]);
532
632
  });
633
+ _defineProperty(this, "renderAnimatedSheetChildren", children => {
634
+ if (!this.state.contentAnimatableProps) {
635
+ return children;
636
+ }
637
+ return /*#__PURE__*/React.createElement(Animatable.View, _extends({
638
+ key: this.state.contentAnimationId
639
+ }, this.state.contentAnimatableProps), children);
640
+ });
533
641
  _defineProperty(this, "renderContent", props => {
534
642
  // Don't render if shared values aren't initialized yet
535
643
  if (!this.translateY || !this.backdropOpacity || !this.sheetHeight || !this.lastGestureDyShared) {
@@ -550,8 +658,14 @@ export default class WmBottomsheet extends BaseComponent {
550
658
  this.topInset = topInset;
551
659
  });
552
660
  }
661
+ const absoluteStyle = {
662
+ top: 0,
663
+ left: 0,
664
+ right: 0
665
+ };
666
+ const rootStyle = props.modal ? [this.styles.root, absoluteStyle] : this.styles.root;
553
667
  return /*#__PURE__*/React.createElement(View, _extends({
554
- style: this.styles.root
668
+ style: rootStyle
555
669
  }, this.getTestProps('keyboardview')), this._background, /*#__PURE__*/React.createElement(AnimatedBottomsheetContent, {
556
670
  translateY: this.translateY,
557
671
  backdropOpacity: this.backdropOpacity,
@@ -564,8 +678,21 @@ export default class WmBottomsheet extends BaseComponent {
564
678
  onBackdropPress: this.handleBackdropPress,
565
679
  onDragHandlePress: this.handleDragHandlePress,
566
680
  getTestProps: this.getTestProps.bind(this),
567
- enabledragsettle: props.enabledragsettle
568
- }, contentStyle => /*#__PURE__*/React.createElement(ScrollView, _extends({
681
+ enabledragsettle: props.enabledragsettle,
682
+ scrollRef: this.state.scrollViewRef,
683
+ containerScrollRef: this.containerscrollViewRef,
684
+ configurePanGesture: this.configurePanGesture
685
+ }, contentStyle => props.issticky ? props.enablemodalsupport ? /*#__PURE__*/React.createElement(ModalProvider, {
686
+ value: this.sheetModalService
687
+ }, /*#__PURE__*/React.createElement(Animated.View, {
688
+ style: [contentStyle, this.styles.sheetContentContainer, {
689
+ overflow: 'hidden'
690
+ }]
691
+ }, props.children)) : /*#__PURE__*/React.createElement(Animated.View, {
692
+ style: [contentStyle, this.styles.sheetContentContainer, {
693
+ overflow: 'hidden'
694
+ }]
695
+ }, props.children) : /*#__PURE__*/React.createElement(ScrollView, _extends({
569
696
  ref: this.state.scrollViewRef,
570
697
  style: this.styles.sheetContentContainer,
571
698
  contentContainerStyle: [this.styles.sheetScrollContent],
@@ -581,9 +708,9 @@ export default class WmBottomsheet extends BaseComponent {
581
708
  value: this.sheetModalService
582
709
  }, /*#__PURE__*/React.createElement(Animated.View, {
583
710
  style: contentStyle
584
- }, props.children)) : /*#__PURE__*/React.createElement(Animated.View, {
711
+ }, this.renderAnimatedSheetChildren(props.children))) : /*#__PURE__*/React.createElement(Animated.View, {
585
712
  style: contentStyle
586
- }, props.children))), Platform.OS === 'android' && !this.props.modal && bottomInset > 40 && /*#__PURE__*/React.createElement(SafeAreaView, {
713
+ }, this.renderAnimatedSheetChildren(props.children)))), Platform.OS === 'android' && !this.props.modal && bottomInset > 40 && /*#__PURE__*/React.createElement(SafeAreaView, {
587
714
  edges: ['bottom']
588
715
  }), props.enablemodalsupport && this.state.localModalsOpened && this.state.localModalsOpened.map((o, i) => /*#__PURE__*/React.createElement(View, {
589
716
  key: (o.name || '') + i,
@@ -601,7 +728,18 @@ export default class WmBottomsheet extends BaseComponent {
601
728
  });
602
729
  });
603
730
  this.calculatedHeight = this.calculateSheetHeight(_props.bottomsheetheightratio);
604
-
731
+ //container srollview ref
732
+ this.subscribe('containerScrollViewReady', ref => {
733
+ if (ref && ref.current && this.containerscrollViewRef !== ref) {
734
+ this.containerscrollViewRef = ref;
735
+ this.forceUpdate();
736
+ }
737
+ });
738
+ //container scrollview y offset value
739
+ this.subscribe('scroll', e => {
740
+ const offsetY = e.nativeEvent.contentOffset.y;
741
+ this.containerscrollYoffset = offsetY;
742
+ });
605
743
  // Use bottomsheetexpandedheightratio if provided, otherwise use expandedDefaultHeight
606
744
  const expandedRatio = _props.bottomsheetexpandedheightratio || this.expandedDefaultHeight;
607
745
  const effectiveExpandedRatio = Math.max(this.minimumExpandedHeight, Math.min(expandedRatio, this.maxHeight));
@@ -756,13 +894,17 @@ export default class WmBottomsheet extends BaseComponent {
756
894
  }
757
895
  },
758
896
  statusBarTranslucent: false
897
+ }, /*#__PURE__*/React.createElement(GestureHandlerRootView, {
898
+ style: {
899
+ flex: 1
900
+ }
759
901
  }, wrapWithSafeArea(/*#__PURE__*/React.createElement(KeyboardAvoidingView, {
760
902
  style: {
761
903
  flex: 1
762
904
  },
763
905
  behavior: 'padding',
764
906
  keyboardVerticalOffset: Platform.OS === 'ios' ? 0 : undefined
765
- }, this.renderContent(props))));
907
+ }, this.renderContent(props)))));
766
908
  } else {
767
909
  return this.renderContent(props);
768
910
  }