@wavemaker/app-rn-runtime 11.11.7-rc.6211 → 11.12.0-next.28188

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 (210) hide show
  1. package/components/advanced/carousel/carousel.component.js +4 -2
  2. package/components/advanced/carousel/carousel.component.js.map +1 -1
  3. package/components/basic/anchor/anchor.component.js +11 -5
  4. package/components/basic/anchor/anchor.component.js.map +1 -1
  5. package/components/basic/anchor/anchor.props.js +1 -0
  6. package/components/basic/anchor/anchor.props.js.map +1 -1
  7. package/components/basic/audio/audio.component.js +52 -47
  8. package/components/basic/audio/audio.component.js.map +1 -1
  9. package/components/basic/bottomsheet/bottomsheet.component.js +94 -48
  10. package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
  11. package/components/basic/bottomsheet/bottomsheet.props.js +1 -0
  12. package/components/basic/bottomsheet/bottomsheet.props.js.map +1 -1
  13. package/components/basic/button/button.component.js +2 -1
  14. package/components/basic/button/button.component.js.map +1 -1
  15. package/components/basic/button/button.props.js +1 -0
  16. package/components/basic/button/button.props.js.map +1 -1
  17. package/components/basic/label/label.component.js.map +1 -1
  18. package/components/basic/label/label.props.js +1 -0
  19. package/components/basic/label/label.props.js.map +1 -1
  20. package/components/basic/message/message.component.js +15 -7
  21. package/components/basic/message/message.component.js.map +1 -1
  22. package/components/basic/message/message.props.js +1 -0
  23. package/components/basic/message/message.props.js.map +1 -1
  24. package/components/basic/picture/picture.component.js +2 -2
  25. package/components/basic/picture/picture.component.js.map +1 -1
  26. package/components/basic/video/video.component.js +69 -42
  27. package/components/basic/video/video.component.js.map +1 -1
  28. package/components/chart/basechart.props.js +1 -0
  29. package/components/chart/basechart.props.js.map +1 -1
  30. package/components/container/container.component.js +107 -27
  31. package/components/container/container.component.js.map +1 -1
  32. package/components/container/container.props.js +3 -1
  33. package/components/container/container.props.js.map +1 -1
  34. package/components/container/container.styles.js +1 -3
  35. package/components/container/container.styles.js.map +1 -1
  36. package/components/container/layoutgrid/gridcolumn/gridcolumn.component.js +6 -1
  37. package/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
  38. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +2 -2
  39. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
  40. package/components/container/tabs/tabheader/tabheader.component.js +11 -2
  41. package/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  42. package/components/container/tabs/tabheader/tabheader.props.js +1 -0
  43. package/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
  44. package/components/container/tabs/tabpane/tabpane.props.js +3 -0
  45. package/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
  46. package/components/container/tabs/tabs.component.js +11 -2
  47. package/components/container/tabs/tabs.component.js.map +1 -1
  48. package/components/container/wizard/wizard.component.js +1 -0
  49. package/components/container/wizard/wizard.component.js.map +1 -1
  50. package/components/data/list/list.component.js +23 -13
  51. package/components/data/list/list.component.js.map +1 -1
  52. package/components/device/barcodescanner/barcodescanner.component.js +33 -18
  53. package/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  54. package/components/device/barcodescanner/barcodescanner.props.js +2 -1
  55. package/components/device/barcodescanner/barcodescanner.props.js.map +1 -1
  56. package/components/device/camera/camera.component.js +35 -22
  57. package/components/device/camera/camera.component.js.map +1 -1
  58. package/components/device/camera/camera.props.js +2 -1
  59. package/components/device/camera/camera.props.js.map +1 -1
  60. package/components/input/basedataset/basedataset.props.js +1 -0
  61. package/components/input/basedataset/basedataset.props.js.map +1 -1
  62. package/components/input/calendar/calendar.component.js +12 -4
  63. package/components/input/calendar/calendar.component.js.map +1 -1
  64. package/components/input/calendar/views/month-view.js +9 -2
  65. package/components/input/calendar/views/month-view.js.map +1 -1
  66. package/components/input/checkbox/checkbox.component.js +5 -5
  67. package/components/input/checkbox/checkbox.component.js.map +1 -1
  68. package/components/input/checkboxset/checkboxset.component.js +15 -11
  69. package/components/input/checkboxset/checkboxset.component.js.map +1 -1
  70. package/components/input/chips/chips.component.js +25 -12
  71. package/components/input/chips/chips.component.js.map +1 -1
  72. package/components/input/currency/currency.component.js +5 -2
  73. package/components/input/currency/currency.component.js.map +1 -1
  74. package/components/input/epoch/base-datetime.component.js +9 -9
  75. package/components/input/epoch/base-datetime.component.js.map +1 -1
  76. package/components/input/epoch/datetime/datetime.props.js +1 -0
  77. package/components/input/epoch/datetime/datetime.props.js.map +1 -1
  78. package/components/input/epoch/wheelpicker/wheelpicker.component.js +8 -3
  79. package/components/input/epoch/wheelpicker/wheelpicker.component.js.map +1 -1
  80. package/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +8 -3
  81. package/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  82. package/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js +8 -3
  83. package/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js.map +1 -1
  84. package/components/input/fileupload/fileupload.component.js +23 -14
  85. package/components/input/fileupload/fileupload.component.js.map +1 -1
  86. package/components/input/fileupload/fileupload.props.js +2 -0
  87. package/components/input/fileupload/fileupload.props.js.map +1 -1
  88. package/components/input/radioset/radioset.component.js +15 -5
  89. package/components/input/radioset/radioset.component.js.map +1 -1
  90. package/components/input/rating/rating.component.js +11 -3
  91. package/components/input/rating/rating.component.js.map +1 -1
  92. package/components/input/rating/rating.props.js +4 -0
  93. package/components/input/rating/rating.props.js.map +1 -1
  94. package/components/input/select/select.component.js +7 -5
  95. package/components/input/select/select.component.js.map +1 -1
  96. package/components/input/slider/slider.component.js +2 -1
  97. package/components/input/slider/slider.component.js.map +1 -1
  98. package/components/input/switch/switch.component.js +11 -9
  99. package/components/input/switch/switch.component.js.map +1 -1
  100. package/components/input/toggle/toggle.component.js +8 -4
  101. package/components/input/toggle/toggle.component.js.map +1 -1
  102. package/components/input/toggle/toggle.props.js +1 -0
  103. package/components/input/toggle/toggle.props.js.map +1 -1
  104. package/components/navigation/appnavbar/appnavbar.component.js +19 -61
  105. package/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  106. package/components/navigation/navitem/navitem.component.js +3 -1
  107. package/components/navigation/navitem/navitem.component.js.map +1 -1
  108. package/components/navigation/popover/popover.component.js +2 -1
  109. package/components/navigation/popover/popover.component.js.map +1 -1
  110. package/components/navigation/popover/popover.props.js +2 -1
  111. package/components/navigation/popover/popover.props.js.map +1 -1
  112. package/components/page/page-content/page-content.component.js +74 -20
  113. package/components/page/page-content/page-content.component.js.map +1 -1
  114. package/components/page/page-content/page-content.props.js +1 -0
  115. package/components/page/page-content/page-content.props.js.map +1 -1
  116. package/components/page/page.component.js +29 -44
  117. package/components/page/page.component.js.map +1 -1
  118. package/components/page/page.props.js +4 -2
  119. package/components/page/page.props.js.map +1 -1
  120. package/components/page/tabbar/tabbar.component.js +24 -13
  121. package/components/page/tabbar/tabbar.component.js.map +1 -1
  122. package/core/AppConfig.js.map +1 -1
  123. package/core/accessibility.js +51 -32
  124. package/core/accessibility.js.map +1 -1
  125. package/core/base.component.js.map +1 -1
  126. package/core/components/error-fallback/error-fallback.component.js +140 -0
  127. package/core/components/error-fallback/error-fallback.component.js.map +1 -0
  128. package/core/components/error-fallback/error-fallback.styles.js +224 -0
  129. package/core/components/error-fallback/error-fallback.styles.js.map +1 -0
  130. package/core/components/sticky-base.component.js +54 -0
  131. package/core/components/sticky-base.component.js.map +1 -0
  132. package/core/components/sticky-container.component.js +34 -0
  133. package/core/components/sticky-container.component.js.map +1 -0
  134. package/core/components/sticky-container.styles.js +98 -0
  135. package/core/components/sticky-container.styles.js.map +1 -0
  136. package/core/components/sticky-nav.component.js +28 -0
  137. package/core/components/sticky-nav.component.js.map +1 -0
  138. package/core/device/av-service.js +8 -0
  139. package/core/device/av-service.js.map +1 -0
  140. package/core/device/calendar-service.js +7 -1
  141. package/core/device/calendar-service.js.map +1 -1
  142. package/core/device/camera-service.js +6 -0
  143. package/core/device/camera-service.js.map +1 -1
  144. package/core/device/contacts-service.js +7 -1
  145. package/core/device/contacts-service.js.map +1 -1
  146. package/core/device/fileupload-service.js +8 -0
  147. package/core/device/fileupload-service.js.map +1 -0
  148. package/core/device/location-service.js +7 -1
  149. package/core/device/location-service.js.map +1 -1
  150. package/core/device/scan-service.js +6 -0
  151. package/core/device/scan-service.js.map +1 -1
  152. package/core/error-boundary.component.js +1 -1
  153. package/core/error-boundary.component.js.map +1 -1
  154. package/core/event-notifier.js +4 -3
  155. package/core/event-notifier.js.map +1 -1
  156. package/core/fixed-view.component.js +2 -1
  157. package/core/fixed-view.component.js.map +1 -1
  158. package/core/responsive.utils.js +8 -5
  159. package/core/responsive.utils.js.map +1 -1
  160. package/core/sticky-view.component.js +50 -0
  161. package/core/sticky-view.component.js.map +1 -0
  162. package/core/sticky-wrapper.js +129 -0
  163. package/core/sticky-wrapper.js.map +1 -0
  164. package/core/utils.js +0 -6
  165. package/core/utils.js.map +1 -1
  166. package/npm-shrinkwrap.json +48 -47
  167. package/package-lock.json +48 -47
  168. package/package.json +2 -2
  169. package/runtime/App.js +3 -5
  170. package/runtime/App.js.map +1 -1
  171. package/runtime/services/device/calendar-service.js +9 -5
  172. package/runtime/services/device/calendar-service.js.map +1 -1
  173. package/runtime/services/device/camera-service.js +39 -22
  174. package/runtime/services/device/camera-service.js.map +1 -1
  175. package/runtime/services/device/contacts-service.js +6 -5
  176. package/runtime/services/device/contacts-service.js.map +1 -1
  177. package/runtime/services/device/location-service.js +4 -4
  178. package/runtime/services/device/location-service.js.map +1 -1
  179. package/runtime/services/device/permission-service.js +5 -0
  180. package/runtime/services/device/permission-service.js.map +1 -0
  181. package/runtime/services/device/permissions.js +34 -39
  182. package/runtime/services/device/permissions.js.map +1 -1
  183. package/runtime/services/device/scan-service.js +4 -3
  184. package/runtime/services/device/scan-service.js.map +1 -1
  185. package/styles/theme.js +24 -18
  186. package/styles/theme.js.map +1 -1
  187. package/variables/device/calendar/create-event.operation.js +12 -1
  188. package/variables/device/calendar/create-event.operation.js.map +1 -1
  189. package/variables/device/calendar/delete-event.operation.js +12 -1
  190. package/variables/device/calendar/delete-event.operation.js.map +1 -1
  191. package/variables/device/calendar/get-events.operation.js +12 -1
  192. package/variables/device/calendar/get-events.operation.js.map +1 -1
  193. package/variables/device/camera/capture-image.operation.js +8 -1
  194. package/variables/device/camera/capture-image.operation.js.map +1 -1
  195. package/variables/device/camera/capture-video.operation.js +7 -1
  196. package/variables/device/camera/capture-video.operation.js.map +1 -1
  197. package/variables/device/contacts/get-contacts.operation.js +12 -1
  198. package/variables/device/contacts/get-contacts.operation.js.map +1 -1
  199. package/variables/device/device/current-geo-position.operation.js +12 -1
  200. package/variables/device/device/current-geo-position.operation.js.map +1 -1
  201. package/variables/device/file/upload-file.operation.js +17 -3
  202. package/variables/device/file/upload-file.operation.js.map +1 -1
  203. package/variables/device/scan/scan.operation.js +12 -1
  204. package/variables/device/scan/scan.operation.js.map +1 -1
  205. package/variables/http.service.js +6 -1
  206. package/variables/http.service.js.map +1 -1
  207. package/core/components/error-fallback.component.js +0 -264
  208. package/core/components/error-fallback.component.js.map +0 -1
  209. package/core/sticky-container.component.js +0 -175
  210. package/core/sticky-container.component.js.map +0 -1
@@ -0,0 +1,28 @@
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 React from 'react';
5
+ import { StickyBaseView } from './sticky-base.component';
6
+ import { StickyWrapperContext } from '../sticky-wrapper';
7
+ import Animated from 'react-native-reanimated';
8
+ export class StickyNav extends StickyBaseView {
9
+ constructor(props) {
10
+ super(props);
11
+ }
12
+ renderView() {
13
+ return /*#__PURE__*/React.createElement(StickyWrapperContext.Consumer, null, context => {
14
+ const {
15
+ stickyNavAnimateStyle
16
+ } = context || {};
17
+ return /*#__PURE__*/React.createElement(Animated.View, {
18
+ style: [stickyNavAnimateStyle],
19
+ key: `nav-${this.id}`
20
+ }, this.props.children);
21
+ });
22
+ }
23
+ }
24
+ _defineProperty(StickyNav, "defaultProps", {
25
+ show: true
26
+ });
27
+ _defineProperty(StickyNav, "contextType", StickyWrapperContext);
28
+ //# sourceMappingURL=sticky-nav.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StickyBaseView","StickyWrapperContext","Animated","StickyNav","constructor","props","renderView","createElement","Consumer","context","stickyNavAnimateStyle","View","style","key","id","children","_defineProperty","show"],"sources":["sticky-nav.component.tsx"],"sourcesContent":["import React from 'react';\nimport { StickyBaseView, StickyBaseViewProps } from './sticky-base.component';\nimport { StickyWrapperContext } from '../sticky-wrapper';\nimport Animated from 'react-native-reanimated';\n\ninterface StickyNavProps extends StickyBaseViewProps {}\n\nexport class StickyNav extends StickyBaseView {\n static defaultProps = {\n show: true\n };\n static contextType = StickyWrapperContext;\n\n constructor(props: StickyNavProps) {\n super(props);\n }\n\n renderView() {\n return <StickyWrapperContext.Consumer>\n {(context) => {\n const { stickyNavAnimateStyle } = context || {};\n return (\n <Animated.View style={[stickyNavAnimateStyle as any]}\n key={`nav-${this.id}`}\n >\n {this.props.children}\n </Animated.View>\n );\n }}\n </StickyWrapperContext.Consumer>\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAA6B,yBAAyB;AAC7E,SAASC,oBAAoB,QAAQ,mBAAmB;AACxD,OAAOC,QAAQ,MAAM,yBAAyB;AAI9C,OAAO,MAAMC,SAAS,SAASH,cAAc,CAAC;EAM5CI,WAAWA,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,CAAC;EACd;EAEAC,UAAUA,CAAA,EAAG;IACX,oBAAOP,KAAA,CAAAQ,aAAA,CAACN,oBAAoB,CAACO,QAAQ,QACjCC,OAAO,IAAK;MACZ,MAAM;QAAEC;MAAsB,CAAC,GAAGD,OAAO,IAAI,CAAC,CAAC;MAC/C,oBACEV,KAAA,CAAAQ,aAAA,CAACL,QAAQ,CAACS,IAAI;QAACC,KAAK,EAAE,CAACF,qBAAqB,CAAS;QACnDG,GAAG,EAAE,OAAO,IAAI,CAACC,EAAE;MAAG,GAErB,IAAI,CAACT,KAAK,CAACU,QACC,CAAC;IAEpB,CAC6B,CAAC;EAClC;AACF;AAACC,eAAA,CAxBYb,SAAS,kBACE;EACpBc,IAAI,EAAE;AACR,CAAC;AAAAD,eAAA,CAHUb,SAAS,iBAICF,oBAAoB","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ const AudioContext = /*#__PURE__*/React.createContext(null);
3
+ const VideoContext = /*#__PURE__*/React.createContext(null);
4
+ export const AudioProvider = AudioContext.Provider;
5
+ export const AudioConsumer = AudioContext.Consumer;
6
+ export const VideoProvider = VideoContext.Provider;
7
+ export const VideoConsumer = VideoContext.Consumer;
8
+ //# sourceMappingURL=av-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","AudioContext","createContext","VideoContext","AudioProvider","Provider","AudioConsumer","Consumer","VideoProvider","VideoConsumer"],"sources":["av-service.ts"],"sourcesContent":["import React from 'react';\n\nexport interface AudioService {\n createAudio: (source: any, params: any) => any\n}\nexport interface VideoService {}\nconst AudioContext = React.createContext<AudioService>(null as any);\nconst VideoContext = React.createContext<VideoService>(null as any);\n\nexport const AudioProvider = AudioContext.Provider;\nexport const AudioConsumer = AudioContext.Consumer;\nexport const VideoProvider = VideoContext.Provider;\nexport const VideoConsumer = VideoContext.Consumer;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAMzB,MAAMC,YAAY,gBAAGD,KAAK,CAACE,aAAa,CAAe,IAAW,CAAC;AACnE,MAAMC,YAAY,gBAAGH,KAAK,CAACE,aAAa,CAAe,IAAW,CAAC;AAEnE,OAAO,MAAME,aAAa,GAAGH,YAAY,CAACI,QAAQ;AAClD,OAAO,MAAMC,aAAa,GAAGL,YAAY,CAACM,QAAQ;AAClD,OAAO,MAAMC,aAAa,GAAGL,YAAY,CAACE,QAAQ;AAClD,OAAO,MAAMI,aAAa,GAAGN,YAAY,CAACI,QAAQ","ignoreList":[]}
@@ -1,2 +1,8 @@
1
- export {};
1
+ import React from 'react';
2
+
3
+ // * expo-calendar plugin
4
+
5
+ const CalendarPluginContext = /*#__PURE__*/React.createContext(null);
6
+ export const CalendarPluginProvider = CalendarPluginContext.Provider;
7
+ export const CalendarPluginConsumer = CalendarPluginContext.Consumer;
2
8
  //# sourceMappingURL=calendar-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["calendar-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\n\nexport interface CalendarInput extends Input {\n eventTitle: string;\n eventLocation: string;\n eventNotes: string;\n eventStart: Date;\n eventEnd: Date;\n}\n\nexport interface CalendarService {\n getEvents: (params: CalendarInput) => any;\n createEvent: (params: CalendarInput) => any;\n deleteEvent: (params: CalendarInput) => any;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":["React","CalendarPluginContext","createContext","CalendarPluginProvider","Provider","CalendarPluginConsumer","Consumer"],"sources":["calendar-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\nimport React from 'react';\n\nexport interface CalendarInput extends Input {\n eventTitle: string;\n eventLocation: string;\n eventNotes: string;\n eventStart: Date;\n eventEnd: Date;\n calendarPluginService: any;\n permissionService: any;\n}\n\nexport interface CalendarService {\n getEvents: (params: CalendarInput) => any;\n createEvent: (params: CalendarInput) => any;\n deleteEvent: (params: CalendarInput) => any;\n}\n\n// * expo-calendar plugin\nexport interface CalendarPluginService {\n getCalendarsAsync: any;\n getEventsAsync: any;\n createEventAsync: any;\n deleteEventAsync: any;\n}\nconst CalendarPluginContext = React.createContext<CalendarPluginService>(null as any);\n\nexport const CalendarPluginProvider = CalendarPluginContext.Provider;\nexport const CalendarPluginConsumer = CalendarPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;;AAkBzB;;AAOA,MAAMC,qBAAqB,gBAAGD,KAAK,CAACE,aAAa,CAAwB,IAAW,CAAC;AAErF,OAAO,MAAMC,sBAAsB,GAAGF,qBAAqB,CAACG,QAAQ;AACpE,OAAO,MAAMC,sBAAsB,GAAGJ,qBAAqB,CAACK,QAAQ","ignoreList":[]}
@@ -2,4 +2,10 @@ import React from 'react';
2
2
  const CameraContext = /*#__PURE__*/React.createContext(null);
3
3
  export const CameraProvider = CameraContext.Provider;
4
4
  export const CameraConsumer = CameraContext.Consumer;
5
+
6
+ // * expo-camera plugin
7
+
8
+ const CameraPluginContext = /*#__PURE__*/React.createContext(null);
9
+ export const CameraPluginProvider = CameraPluginContext.Provider;
10
+ export const CameraPluginConsumer = CameraPluginContext.Consumer;
5
11
  //# sourceMappingURL=camera-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","CameraContext","createContext","CameraProvider","Provider","CameraConsumer","Consumer"],"sources":["camera-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\nimport React from 'react';\n\nexport interface CameraInput extends Input {\n allowImageEdit: boolean;\n imageQuality: number;\n imageEncodingType: string;\n imageTargetWidth: number;\n imageTargetHeight: number;\n}\n\nexport interface CameraService {\n captureImage: (params: CameraInput) => any\n captureVideo: () => any;\n}\nconst CameraContext = React.createContext<CameraService>(null as any);\n\nexport const CameraProvider = CameraContext.Provider;\nexport const CameraConsumer = CameraContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AAczB,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAa,CAAgB,IAAW,CAAC;AAErE,OAAO,MAAMC,cAAc,GAAGF,aAAa,CAACG,QAAQ;AACpD,OAAO,MAAMC,cAAc,GAAGJ,aAAa,CAACK,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["React","CameraContext","createContext","CameraProvider","Provider","CameraConsumer","Consumer","CameraPluginContext","CameraPluginProvider","CameraPluginConsumer"],"sources":["camera-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\nimport React from 'react';\n\nexport interface CameraInput extends Input {\n allowImageEdit: boolean;\n imageQuality: number;\n imageEncodingType: string;\n imageTargetWidth: number;\n imageTargetHeight: number;\n permissionService: any;\n}\n\nexport interface CameraVideoInput {\n permissionService: any;\n}\n\nexport interface CameraService {\n captureImage: (params: CameraInput) => any\n captureVideo: (params: CameraVideoInput) => any;\n}\nconst CameraContext = React.createContext<CameraService>(null as any);\n\nexport const CameraProvider = CameraContext.Provider;\nexport const CameraConsumer = CameraContext.Consumer;\n\n// * expo-camera plugin\nexport interface CameraPluginService {\n CameraView: any;\n Video: any;\n fsReadAsString: (uri: any, params: any) => any;\n}\nconst CameraPluginContext = React.createContext<CameraPluginService>(null as any);\n\nexport const CameraPluginProvider = CameraPluginContext.Provider;\nexport const CameraPluginConsumer = CameraPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AAmBzB,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAa,CAAgB,IAAW,CAAC;AAErE,OAAO,MAAMC,cAAc,GAAGF,aAAa,CAACG,QAAQ;AACpD,OAAO,MAAMC,cAAc,GAAGJ,aAAa,CAACK,QAAQ;;AAEpD;;AAMA,MAAMC,mBAAmB,gBAAGP,KAAK,CAACE,aAAa,CAAsB,IAAW,CAAC;AAEjF,OAAO,MAAMM,oBAAoB,GAAGD,mBAAmB,CAACH,QAAQ;AAChE,OAAO,MAAMK,oBAAoB,GAAGF,mBAAmB,CAACD,QAAQ","ignoreList":[]}
@@ -1,2 +1,8 @@
1
- export {};
1
+ import React from 'react';
2
+
3
+ // * expo-contacts plugin
4
+
5
+ const ContactsPluginContext = /*#__PURE__*/React.createContext(null);
6
+ export const ContactsPluginProvider = ContactsPluginContext.Provider;
7
+ export const ContactsPluginConsumer = ContactsPluginContext.Consumer;
2
8
  //# sourceMappingURL=contacts-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["contacts-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\n\nexport interface ContactsInput extends Input {\n contactFilter: string;\n}\n\nexport interface ContactsService {\n getContacts: (params: ContactsInput) => any;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":["React","ContactsPluginContext","createContext","ContactsPluginProvider","Provider","ContactsPluginConsumer","Consumer"],"sources":["contacts-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\nimport React from 'react';\n\nexport interface ContactsInput extends Input {\n contactFilter: string;\n contactsPluginService: any;\n permissionService: any;\n}\n\nexport interface ContactsService {\n getContacts: (params: ContactsInput) => any;\n}\n\n// * expo-contacts plugin\nexport interface ContactsPluginService {\n Fields: any;\n getContactsAsync: any;\n}\nconst ContactsPluginContext = React.createContext<ContactsPluginService>(null as any);\n\nexport const ContactsPluginProvider = ContactsPluginContext.Provider;\nexport const ContactsPluginConsumer = ContactsPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;;AAYzB;;AAKA,MAAMC,qBAAqB,gBAAGD,KAAK,CAACE,aAAa,CAAwB,IAAW,CAAC;AAErF,OAAO,MAAMC,sBAAsB,GAAGF,qBAAqB,CAACG,QAAQ;AACpE,OAAO,MAAMC,sBAAsB,GAAGJ,qBAAqB,CAACK,QAAQ","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+
3
+ // * expo-document-picker plugin
4
+
5
+ const FileUploadPluginContext = /*#__PURE__*/React.createContext(null);
6
+ export const FileUploadPluginProvider = FileUploadPluginContext.Provider;
7
+ export const FileUploadPluginConsumer = FileUploadPluginContext.Consumer;
8
+ //# sourceMappingURL=fileupload-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","FileUploadPluginContext","createContext","FileUploadPluginProvider","Provider","FileUploadPluginConsumer","Consumer"],"sources":["fileupload-service.ts"],"sourcesContent":["import React from 'react';\n\n// * expo-document-picker plugin\nexport interface FileUploadPluginService {\n getDocumentAsync: any;\n}\nconst FileUploadPluginContext = React.createContext<FileUploadPluginService>(null as any);\n\nexport const FileUploadPluginProvider = FileUploadPluginContext.Provider;\nexport const FileUploadPluginConsumer = FileUploadPluginContext.Consumer;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;;AAIA,MAAMC,uBAAuB,gBAAGD,KAAK,CAACE,aAAa,CAA0B,IAAW,CAAC;AAEzF,OAAO,MAAMC,wBAAwB,GAAGF,uBAAuB,CAACG,QAAQ;AACxE,OAAO,MAAMC,wBAAwB,GAAGJ,uBAAuB,CAACK,QAAQ","ignoreList":[]}
@@ -1,2 +1,8 @@
1
- export {};
1
+ import React from "react";
2
+
3
+ // * expo-location plugin
4
+
5
+ const LocationPluginContext = /*#__PURE__*/React.createContext(null);
6
+ export const LocationPluginProvider = LocationPluginContext.Provider;
7
+ export const LocationPluginConsumer = LocationPluginContext.Consumer;
2
8
  //# sourceMappingURL=location-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["location-service.ts"],"sourcesContent":["import {Input} from \"@wavemaker/app-rn-runtime/variables/device/operation.provider\";\n\nexport interface GeoPositionInput extends Input {\n maximumAge: number;\n timeout: number;\n enableHighAccuracy: boolean;\n}\n\nexport interface LocationService {\n getCurrentGeoPosition: (params: GeoPositionInput) => any;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":["React","LocationPluginContext","createContext","LocationPluginProvider","Provider","LocationPluginConsumer","Consumer"],"sources":["location-service.ts"],"sourcesContent":["import {Input} from \"@wavemaker/app-rn-runtime/variables/device/operation.provider\";\nimport React from \"react\";\n\nexport interface GeoPositionInput extends Input {\n maximumAge: number;\n timeout: number;\n enableHighAccuracy: boolean;\n permissionService: any;\n locationPluginService: any;\n}\n\nexport interface LocationService {\n getCurrentGeoPosition: (params: GeoPositionInput) => any;\n}\n\n// * expo-location plugin\nexport interface LocationPluginService {}\nconst LocationPluginContext = React.createContext<LocationPluginService>(null as any);\n\nexport const LocationPluginProvider = LocationPluginContext.Provider;\nexport const LocationPluginConsumer = LocationPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;;AAczB;;AAEA,MAAMC,qBAAqB,gBAAGD,KAAK,CAACE,aAAa,CAAwB,IAAW,CAAC;AAErF,OAAO,MAAMC,sBAAsB,GAAGF,qBAAqB,CAACG,QAAQ;AACpE,OAAO,MAAMC,sBAAsB,GAAGJ,qBAAqB,CAACK,QAAQ","ignoreList":[]}
@@ -2,4 +2,10 @@ import React from 'react';
2
2
  const ScanContext = /*#__PURE__*/React.createContext(null);
3
3
  export const ScanProvider = ScanContext.Provider;
4
4
  export const ScanConsumer = ScanContext.Consumer;
5
+
6
+ // * scan service plugin
7
+
8
+ const ScanPluginContext = /*#__PURE__*/React.createContext(null);
9
+ export const ScanPluginProvider = ScanPluginContext.Provider;
10
+ export const ScanPluginConsumer = ScanPluginContext.Consumer;
5
11
  //# sourceMappingURL=scan-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","ScanContext","createContext","ScanProvider","Provider","ScanConsumer","Consumer"],"sources":["scan-service.ts"],"sourcesContent":["import {ScanInput} from \"@wavemaker/app-rn-runtime/variables/device/scan/scan.operation\";\nimport React from 'react';\n\nexport interface ScanService {\n scanBarcode: (params: ScanInput) => any;\n}\nconst ScanContext = React.createContext<ScanService>(null as any);\n\nexport const ScanProvider = ScanContext.Provider;\nexport const ScanConsumer = ScanContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AAKzB,MAAMC,WAAW,gBAAGD,KAAK,CAACE,aAAa,CAAc,IAAW,CAAC;AAEjE,OAAO,MAAMC,YAAY,GAAGF,WAAW,CAACG,QAAQ;AAChD,OAAO,MAAMC,YAAY,GAAGJ,WAAW,CAACK,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["React","ScanContext","createContext","ScanProvider","Provider","ScanConsumer","Consumer","ScanPluginContext","ScanPluginProvider","ScanPluginConsumer"],"sources":["scan-service.ts"],"sourcesContent":["import {ScanInput} from \"@wavemaker/app-rn-runtime/variables/device/scan/scan.operation\";\nimport React from 'react';\n\nexport interface ScanService {\n scanBarcode: (params: ScanInput) => any;\n}\nconst ScanContext = React.createContext<ScanService>(null as any);\n\nexport const ScanProvider = ScanContext.Provider;\nexport const ScanConsumer = ScanContext.Consumer;\n\n// * scan service plugin\nexport interface ScanPluginService {\n CameraView: any;\n}\nconst ScanPluginContext = React.createContext<ScanPluginService>(null as any);\n\nexport const ScanPluginProvider = ScanPluginContext.Provider;\nexport const ScanPluginConsumer = ScanPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AAKzB,MAAMC,WAAW,gBAAGD,KAAK,CAACE,aAAa,CAAc,IAAW,CAAC;AAEjE,OAAO,MAAMC,YAAY,GAAGF,WAAW,CAACG,QAAQ;AAChD,OAAO,MAAMC,YAAY,GAAGJ,WAAW,CAACK,QAAQ;;AAEhD;;AAIA,MAAMC,iBAAiB,gBAAGP,KAAK,CAACE,aAAa,CAAoB,IAAW,CAAC;AAE7E,OAAO,MAAMM,kBAAkB,GAAGD,iBAAiB,CAACH,QAAQ;AAC5D,OAAO,MAAMK,kBAAkB,GAAGF,iBAAiB,CAACD,QAAQ","ignoreList":[]}
@@ -2,7 +2,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
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
4
  import * as React from 'react';
5
- import Fallback from './components/error-fallback.component';
5
+ import Fallback from './components/error-fallback/error-fallback.component';
6
6
  import appModalService from '@wavemaker/app-rn-runtime/runtime/services/app-modal.service';
7
7
  export default class ErrorBoundary extends React.Component {
8
8
  constructor(props) {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Fallback","appModalService","ErrorBoundary","Component","constructor","props","_defineProperty","setState","hasError","error","undefined","info","state","getDerivedStateFromError","componentDidCatch","modalsOpened","length","pop","showLastModal","render","_this$state","_this$state2","createElement","resetErrorBoundary","children"],"sources":["error-boundary.component.tsx"],"sourcesContent":["import * as React from 'react';\nimport Fallback from './components/error-fallback.component';\nimport appModalService from '@wavemaker/app-rn-runtime/runtime/services/app-modal.service';\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n info?: any;\n error?: any;\n}\n\ninterface ErrorBoundaryProps {\n currentPage?: any;\n children: React.ReactNode;\n}\n\nexport default class ErrorBoundary extends React.Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n \n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n resetErrorBoundary = () => {\n this.setState({ hasError: false, error: undefined, info: undefined });\n };\n\n componentDidCatch(error: any, info: any) {\n if(error && appModalService.modalsOpened.length > 0){\n appModalService.modalsOpened.pop();\n (appModalService as any).showLastModal();\n }\n this.setState({ error, info });\n }\n\n render() {\n if (this.state.hasError) {\n return <Fallback error={this.state?.error} info={this.state?.info} resetErrorBoundary={this.resetErrorBoundary} />;\n }\n\n return this.props.children;\n }\n}\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,QAAQ,MAAM,uCAAuC;AAC5D,OAAOC,eAAe,MAAM,8DAA8D;AAa1F,e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oundary","Component","constructor","props","_defineProperty","setState","hasError","error","undefined","info","state","getDerivedStateFromError","componentDidCatch","modalsOpened","length","pop","showLastModal","render","_this$state","_this$state2","createElement","resetErrorBoundary","children"],"sources":["error-boundary.component.tsx"],"sourcesContent":["import * as React from 'react';\nimport Fallback from './components/error-fallback/error-fallback.component';\nimport appModalService from '@wavemaker/app-rn-runtime/runtime/services/app-modal.service';\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n info?: any;\n error?: any;\n}\n\ninterface ErrorBoundaryProps {\n currentPage?: any;\n children: React.ReactNode;\n}\n\nexport default class ErrorBoundary extends React.Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n \n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n resetErrorBoundary = () => {\n this.setState({ hasError: false, error: undefined, info: undefined });\n };\n\n componentDidCatch(error: any, info: any) {\n if(error && appModalService.modalsOpened.length > 0){\n appModalService.modalsOpened.pop();\n (appModalService as any).showLastModal();\n }\n this.setState({ error, info });\n }\n\n render() {\n if (this.state.hasError) {\n return <Fallback error={this.state?.error} info={this.state?.info} resetErrorBoundary={this.resetErrorBoundary} />;\n }\n\n return this.props.children;\n }\n}\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,QAAQ,MAAM,sDAAsD;AAC3E,OAAOC,eAAe,MAAM,8DAA8D;AAa1F,eAAe,MAAMC,aAAa,SAASH,KAAK,CAACI,SAAS,CAGxD;EAEAC,WAAWA,CAACC,KAAU,EAAE;IACtB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,6BAQM,MAAM;MACzB,IAAI,CAACC,QAAQ,CAAC;QAAEC,QAAQ,EAAE,KAAK;QAAEC,KAAK,EAAEC,SAAS;QAAEC,IAAI,EAAED;MAAU,CAAC,CAAC;IACvE,CAAC;IATC,IAAI,CAACE,KAAK,GAAG;MAAEJ,QAAQ,EAAE;IAAM,CAAC;EAClC;EAEA,OAAOK,wBAAwBA,CAACJ,KAAU,EAAE;IAC1C,OAAO;MAAED,QAAQ,EAAE;IAAK,CAAC;EAC3B;EAMAM,iBAAiBA,CAACL,KAAU,EAAEE,IAAS,EAAE;IACvC,IAAGF,KAAK,IAAIR,eAAe,CAACc,YAAY,CAACC,MAAM,GAAG,CAAC,EAAC;MAClDf,eAAe,CAACc,YAAY,CAACE,GAAG,CAAC,CAAC;MACjChB,eAAe,CAASiB,aAAa,CAAC,CAAC;IAC1C;IACA,IAAI,CAACX,QAAQ,CAAC;MAAEE,KAAK;MAAEE;IAAK,CAAC,CAAC;EAChC;EAEAQ,MAAMA,CAAA,EAAG;IACP,IAAI,IAAI,CAACP,KAAK,CAACJ,QAAQ,EAAE;MAAA,IAAAY,WAAA,EAAAC,YAAA;MACvB,oBAAOtB,KAAA,CAAAuB,aAAA,CAACtB,QAAQ;QAACS,KAAK,GAAAW,WAAA,GAAE,IAAI,CAACR,KAAK,cAAAQ,WAAA,uBAAVA,WAAA,CAAYX,KAAM;QAACE,IAAI,GAAAU,YAAA,GAAE,IAAI,CAACT,KAAK,cAAAS,YAAA,uBAAVA,YAAA,CAAYV,IAAK;QAACY,kBAAkB,EAAE,IAAI,CAACA;MAAmB,CAAE,CAAC;IACpH;IAEA,OAAO,IAAI,CAAClB,KAAK,CAACmB,QAAQ;EAC5B;AACF","ignoreList":[]}
@@ -31,9 +31,10 @@ export default class EventNotifier {
31
31
  });
32
32
  }
33
33
  if (propagate) {
34
- if (emitToParent) {
35
- var _this$parent;
36
- (_this$parent = this.parent) === null || _this$parent === void 0 || _this$parent.notify(event, args, true);
34
+ var _this$parent;
35
+ if (this.parent && !!((_this$parent = this.parent) !== null && _this$parent !== void 0 && (_this$parent = _this$parent.children) !== null && _this$parent !== void 0 && _this$parent.length) && emitToParent) {
36
+ var _this$parent2;
37
+ (_this$parent2 = this.parent) === null || _this$parent2 === void 0 || _this$parent2.notify(event, args, true);
37
38
  } else {
38
39
  this.children.forEach(c => {
39
40
  c.notify(event, args);
@@ -1 +1 @@
1
- {"version":3,"names":["i","EventNotifier","constructor","_defineProperty","ROOT","setParent","parent","removeFromParent","children","push","notify","event","args","emitToParent","propagate","listeners","find","l","apply","e","console","error","_this$parent","forEach","c","subscribe","fn","eventListeners","findIndex","fni","splice","indexOf","destroy","_EventNotifier"],"sources":["event-notifier.ts"],"sourcesContent":["let i = 1;\nexport default class EventNotifier {\n public static ROOT = new EventNotifier();\n public name = '';\n public id = i++;\n private listeners = {} as any;\n private parent: EventNotifier = EventNotifier.ROOT;\n private children: EventNotifier[] = [];\n\n setParent(parent: EventNotifier) {\n if (parent !== this.parent) {\n this.removeFromParent();\n this.parent = parent;\n this.parent.children.push(this);\n }\n }\n\n public notify(event: string, args: any[], emitToParent = false) {\n let propagate = true;\n if (this.listeners[event]) {\n propagate = !this.listeners[event].find((l: Function) => {\n try {\n return (l && l.apply(null, args)) === false;\n } catch(e) {\n console.error(e);\n }\n return true;\n });\n }\n if (propagate) {\n if (emitToParent) {\n this.parent?.notify(event, args, true);\n } else {\n this.children.forEach((c) => {\n c.notify(event, args);\n });\n }\n }\n }\n\n public subscribe(event: string, fn: Function) {\n this.listeners[event] = this.listeners[event] || [];\n this.listeners[event].push(fn);\n return () => {\n const eventListeners = this.listeners[event];\n const i = eventListeners.findIndex((fni: Function) => fni === fn);\n eventListeners.splice(i, 1);\n };\n }\n\n private removeFromParent() {\n if (this.parent) {\n const i = this.parent.children.indexOf(this) || -1;\n if (i >= 0) {\n this.parent.children.splice(i, 1);\n }\n this.parent = null as any;\n }\n }\n\n public destroy() {\n this.removeFromParent();\n }\n}"],"mappings":";;;;AAAA,IAAIA,CAAC,GAAG,CAAC;AACT,eAAe,MAAMC,aAAa,CAAC;EAAAC,YAAA;IAAAC,eAAA,eAEjB,EAAE;IAAAA,eAAA,aACJH,CAAC,EAAE;IAAAG,eAAA,oBACK,CAAC,CAAC;IAAAA,eAAA,iBACUF,aAAa,CAACG,IAA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AAK,CAAC,IAAI,EAAE;IACnD,IAAI,CAACI,SAAS,CAACJ,KAAK,CAAC,CAACF,IAAI,CAACiB,EAAE,CAAC;IAC9B,OAAO,MAAM;MACT,MAAMC,cAAc,GAAG,IAAI,CAACZ,SAAS,CAACJ,KAAK,CAAC;MAC5C,MAAMX,CAAC,GAAG2B,cAAc,CAACC,SAAS,CAAEC,GAAa,IAAKA,GAAG,KAAKH,EAAE,CAAC;MACjEC,cAAc,CAACG,MAAM,CAAC9B,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;EACL;EAEQO,gBAAgBA,CAAA,EAAG;IACvB,IAAI,IAAI,CAACD,MAAM,EAAE;MACb,MAAMN,CAAC,GAAG,IAAI,CAACM,MAAM,CAACE,QAAQ,CAACuB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;MAClD,IAAI/B,CAAC,IAAI,CAAC,EAAE;QACR,IAAI,CAACM,MAAM,CAACE,QAAQ,CAACsB,MAAM,CAAC9B,CAAC,EAAE,CAAC,CAAC;MACrC;MACA,IAAI,CAACM,MAAM,GAAG,IAAW;IAC7B;EACJ;EAEO0B,OAAOA,CAAA,EAAG;IACb,IAAI,CAACzB,gBAAgB,CAAC,CAAC;EAC3B;AACJ;AAAC0B,cAAA,GA9DoBhC,aAAa;AAAAE,eAAA,CAAbF,aAAa,UACT,IAAIA,cAAa,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["i","EventNotifier","constructor","_defineProperty","ROOT","setParent","parent","removeFromParent","children","push","notify","event","args","emitToParent","propagate","listeners","find","l","apply","e","console","error","_this$parent","length","_this$parent2","forEach","c","subscribe","fn","eventListeners","findIndex","fni","splice","indexOf","destroy","_EventNotifier"],"sources":["event-notifier.ts"],"sourcesContent":["let i = 1;\nexport default class EventNotifier {\n public static ROOT = new EventNotifier();\n public name = '';\n public id = i++;\n private listeners = {} as any;\n private parent: EventNotifier = EventNotifier.ROOT;\n private children: EventNotifier[] = [];\n\n setParent(parent: EventNotifier) {\n if (parent !== this.parent) {\n this.removeFromParent();\n this.parent = parent;\n this.parent.children.push(this);\n }\n }\n\n public notify(event: string, args: any[], emitToParent = false) {\n let propagate = true;\n if (this.listeners[event]) {\n propagate = !this.listeners[event].find((l: Function) => {\n try {\n return (l && l.apply(null, args)) === false;\n } catch(e) {\n console.error(e);\n }\n return true;\n });\n }\n if (propagate) {\n if (this.parent && !!this.parent?.children?.length && emitToParent) {\n this.parent?.notify(event, args, true);\n } else {\n this.children.forEach((c) => {\n c.notify(event, args);\n });\n }\n }\n }\n\n public subscribe(event: string, fn: Function) {\n this.listeners[event] = this.listeners[event] || [];\n this.listeners[event].push(fn);\n return () => {\n const eventListeners = this.listeners[event];\n const i = eventListeners.findIndex((fni: Function) => fni === fn);\n eventListeners.splice(i, 1);\n };\n }\n\n private removeFromParent() {\n if (this.parent) {\n const i = this.parent.children.indexOf(this) || -1;\n if (i >= 0) {\n this.parent.children.splice(i, 1);\n }\n this.parent = null as any;\n }\n }\n\n public destroy() {\n this.removeFromParent();\n }\n}"],"mappings":";;;;AAAA,IAAIA,CAAC,GAAG,CAAC;AACT,eAAe,MAAMC,aAAa,CAAC;EAAAC,YAAA;IAAAC,eAAA,eAEjB,EAAE;IAAAA,eAAA,aACJH,CAAC,EAAE;IAAAG,eAAA,oBACK,CAAC,CAAC;IAAAA,eAAA,iBACUF,aAAa,CAACG,IAAI;IAAAD,eAAA,mBACd,EAAE;EAAA;EAEtCE,SAASA,CAACC,MAAqB,EAAE;IAC7B,IAAIA,MAAM,KAAK,IAAI,CAACA,MAAM,EAAE;MACxB,IAAI,CAACC,gBAAgB,CAAC,CAAC;MACvB,IAAI,CAACD,MAAM,GAAGA,MAAM;MACpB,IAAI,CAACA,MAAM,CAACE,QAAQ,CAACC,IAAI,CAAC,IAAI,CAAC;IACnC;EACJ;EAEOC,MAAMA,CAACC,KAAa,EAAEC,IAAW,EAAEC,YAAY,GAAG,KAAK,EAAE;IAC5D,IAAIC,SAAS,GAAG,IAAI;I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AC5C,MAAMX,CAAC,GAAG6B,cAAc,CAACC,SAAS,CAAEC,GAAa,IAAKA,GAAG,KAAKH,EAAE,CAAC;MACjEC,cAAc,CAACG,MAAM,CAAChC,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;EACL;EAEQO,gBAAgBA,CAAA,EAAG;IACvB,IAAI,IAAI,CAACD,MAAM,EAAE;MACb,MAAMN,CAAC,GAAG,IAAI,CAACM,MAAM,CAACE,QAAQ,CAACyB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;MAClD,IAAIjC,CAAC,IAAI,CAAC,EAAE;QACR,IAAI,CAACM,MAAM,CAACE,QAAQ,CAACwB,MAAM,CAAChC,CAAC,EAAE,CAAC,CAAC;MACrC;MACA,IAAI,CAACM,MAAM,GAAG,IAAW;IAC7B;EACJ;EAEO4B,OAAOA,CAAA,EAAG;IACb,IAAI,CAAC3B,gBAAgB,CAAC,CAAC;EAC3B;AACJ;AAAC4B,cAAA,GA9DoBlC,aAAa;AAAAE,eAAA,CAAbF,aAAa,UACT,IAAIA,cAAa,CAAC,CAAC","ignoreList":[]}
@@ -26,7 +26,8 @@ export class FixedView extends React.Component {
26
26
  }, /*#__PURE__*/React.createElement(WrapperView, {
27
27
  style: [{
28
28
  position: 'absolute'
29
- }, this.props.style]
29
+ }, this.props.style],
30
+ testID: `${this.props.name}-fixed-view`
30
31
  }, this.props.children)));
31
32
  } else {
32
33
  container.remove(this);
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Animated","ThemeProvider","FixedViewContext","createContext","FixedView","Component","constructor","props","_defineProperty","counter","componentWillUnmount","container","remove","render","WrapperView","animated","cachedComponent","usememo","createElement","Consumer","show","add","value","theme","key","id","style","position","children","Fragment","Date","now","FixedViewContainer","args","Map","c","n","set","setTimeout","setState","delete","Provider","Array","from","values"],"sources":["fixed-view.component.tsx"],"sourcesContent":["\nimport React from \"react\";\nimport { View, ViewStyle, Animated } from \"react-native\";\nimport { Theme, ThemeProvider } from \"../styles/theme\";\n\nconst FixedViewContext = React.createContext<FixedViewContainer>(null as any);\n\nexport interface FixedViewProps {\n style?: ViewStyle,\n show?: boolean;\n theme: Theme;\n usememo?: boolean;\n children?: any;\n animated?: boolean;\n}\n\nexport class FixedView extends React.Component<FixedViewProps> {\n static defaultProps = {\n show: true, \n animated: false\n };\n static counter = Date.now();\n container: FixedViewContainer = null as any;\n cachedComponent: React.ReactNode;\n id = FixedView.counter++;\n\n constructor(props: FixedViewProps) {\n super(props);\n }\n\n componentWillUnmount() {\n this.container.remove(this);\n }\n\n render() {\n const WrapperView = this.props.animated ? Animated.View : View\n this.cachedComponent = (this.props.usememo === true && this.cachedComponent ) || (<FixedViewContext.Consumer>\n {(container) => {\n this.container = container;\n if (this.props.show) {\n container.add(this, (\n <ThemeProvider value={this.props.theme} key={this.id}>\n <WrapperView style={[\n {position: 'absolute'},\n this.props.style]}>\n {this.props.children}\n </WrapperView>\n </ThemeProvider>\n ));\n } else {\n container.remove(this);\n }\n return <></>;\n }}\n </FixedViewContext.Consumer>);\n return this.cachedComponent;\n }\n}\n\nexport class FixedViewContainer extends React.Component {\n children: Map<FixedView, React.ReactNode> = new Map();\n id = 0;\n\n add(c: FixedView, n : React.ReactNode) {\n this.children.set(c, n);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n remove(c: FixedView) {\n this.children.delete(c);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n render() {\n return (\n <FixedViewContext.Provider value={this}>\n {(this.props as any).children}\n {Array.from(this.children.values())}\n </FixedViewContext.Provider>\n ) ;\n }\n};"],"mappings":";;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAaC,QAAQ,QAAQ,cAAc;AACxD,SAAgBC,aAAa,QAAQ,iBAAiB;AAEtD,MAAMC,gBAAgB,gBAAGJ,KAAK,CAACK,aAAa,CAAqB,IAAW,CAAC;AAW7E,OAAO,MAAMC,SAAS,SAASN,KAAK,CAACO,SAAS,CAAiB;EAU3DC,W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B,IAAI,EAAE,IAAI;EACVL,QAAQ,EAAE;AACd,CAAC;AAAAP,eAAA,CAJQJ,SAAS,aAKD0B,IAAI,CAACC,GAAG,CAAC,CAAC;AAsC/B,OAAO,MAAMC,kBAAkB,SAASlC,KAAK,CAACO,SAAS,CAAC;EAAAC,YAAA,GAAA2B,IAAA;IAAA,SAAAA,IAAA;IAAAzB,eAAA,mBACR,IAAI0B,GAAG,CAAC,CAAC;IAAA1B,eAAA,aAChD,CAAC;EAAA;EAENa,GAAGA,CAACc,CAAY,EAAEC,CAAmB,EAAE;IACnC,IAAI,CAACR,QAAQ,CAACS,GAAG,CAACF,CAAC,EAAEC,CAAC,CAAC;IACvBE,UAAU,CAAC,MAAM,IAAI,CAACC,QAAQ,CAAC;MAACd,EAAE,EAAE,EAAE,IAAI,CAACA;IAAE,CAAC,CAAC,CAAC;EACpD;EAEAb,MAAMA,CAACuB,CAAY,EAAE;IACjB,IAAI,CAACP,QAAQ,CAACY,MAAM,CAACL,CAAC,CAAC;IACvBG,UAAU,CAAC,MAAM,IAAI,CAACC,QAAQ,CAAC;MAACd,EAAE,EAAE,EAAE,IAAI,CAACA;IAAE,CAAC,CAAC,CAAC;EACpD;EAEAZ,MAAMA,CAAA,EAAG;IACL,oBACIf,KAAA,CAAAoB,aAAA,CAAChB,gBAAgB,CAACuC,QAAQ;MAACnB,KAAK,EAAE;IAAK,GACjC,IAAI,CAACf,KAAK,CAASqB,QAAQ,EAC5Bc,KAAK,CAACC,IAAI,CAAC,IAAI,CAACf,QAAQ,CAACgB,MAAM,CAAC,CAAC,CACX,CAAC;EAEpC;AACJ;AAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Animated","ThemeProvider","FixedViewContext","createContext","FixedView","Component","constructor","props","_defineProperty","counter","componentWillUnmount","container","remove","render","WrapperView","animated","cachedComponent","usememo","createElement","Consumer","show","add","value","theme","key","id","style","position","testID","name","children","Fragment","Date","now","FixedViewContainer","args","Map","c","n","set","setTimeout","setState","delete","Provider","Array","from","values"],"sources":["fixed-view.component.tsx"],"sourcesContent":["\nimport React from \"react\";\nimport { View, ViewStyle, Animated } from \"react-native\";\nimport { Theme, ThemeProvider } from \"../styles/theme\";\n\nconst FixedViewContext = React.createContext<FixedViewContainer>(null as any);\n\nexport interface FixedViewProps {\n name?: string;\n style?: ViewStyle,\n show?: boolean;\n theme: Theme;\n usememo?: boolean;\n children?: any;\n animated?: boolean;\n}\n\nexport class FixedView extends React.Component<FixedViewProps> {\n static defaultProps = {\n show: true, \n animated: false\n };\n static counter = Date.now();\n container: FixedViewContainer = null as any;\n cachedComponent: React.ReactNode;\n id = FixedView.counter++;\n\n constructor(props: FixedViewProps) {\n super(props);\n }\n\n componentWillUnmount() {\n this.container.remove(this);\n }\n\n render() {\n const WrapperView = this.props.animated ? Animated.View : View\n this.cachedComponent = (this.props.usememo === true && this.cachedComponent ) || (<FixedViewContext.Consumer>\n {(container) => {\n this.container = container;\n if (this.props.show) {\n container.add(this, (\n <ThemeProvider value={this.props.theme} key={this.id}>\n <WrapperView style={[\n {position: 'absolute'},\n this.props.style]}\n testID={`${this.props.name}-fixed-view`}\n >\n {this.props.children}\n </WrapperView>\n </ThemeProvider>\n ));\n } else {\n container.remove(this);\n }\n return <></>;\n }}\n </FixedViewContext.Consumer>);\n return this.cachedComponent;\n }\n}\n\nexport class FixedViewContainer extends React.Component {\n children: Map<FixedView, React.ReactNode> = new Map();\n id = 0;\n\n add(c: FixedView, n : React.ReactNode) {\n this.children.set(c, n);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n remove(c: FixedView) {\n this.children.delete(c);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n render() {\n return (\n <FixedViewContext.Provider value={this}>\n {(this.props as any).children}\n {Array.from(this.children.values())}\n </FixedViewContext.Provider>\n ) ;\n }\n};"],"mappings":";;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAaC,QAAQ,QAAQ,cAAc;AACxD,SAAgBC,aAAa,QA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}
@@ -1,6 +1,9 @@
1
1
  import _viewPort from './viewport';
2
- import { DEVICE_BREAK_POINTS, DEVICE_BREAK_POINTS_NATIVE_MOBILE } from '../styles/theme';
3
- import { Platform } from 'react-native';
2
+ import { getBreakPointValue } from '../styles/theme';
3
+ const parseToNumberValue = name => {
4
+ return parseInt(getBreakPointValue(name).replace('px', ''));
5
+ };
6
+
4
7
  /**
5
8
  * Determines the current responsive breakpoint based on viewport width and pixel ratio
6
9
  * @returns The current breakpoint ('xs' | 'sm' | 'md' | 'lg')
@@ -8,11 +11,11 @@ import { Platform } from 'react-native';
8
11
  */
9
12
  export const getCurrentBreakpoint = () => {
10
13
  const width = _viewPort.width;
11
- if (width >= (Platform.OS === 'web' ? parseInt(DEVICE_BREAK_POINTS.MIN_LARGE_DEVICE) : parseInt(DEVICE_BREAK_POINTS_NATIVE_MOBILE.MIN_LARGE_DEVICE))) {
14
+ if (width >= parseToNumberValue('MIN_LARGE_DEVICE')) {
12
15
  return 'lg';
13
- } else if (width >= (Platform.OS === 'web' ? parseInt(DEVICE_BREAK_POINTS.MIN_MEDIUM_DEVICE) : parseInt(DEVICE_BREAK_POINTS_NATIVE_MOBILE.MIN_MEDIUM_DEVICE))) {
16
+ } else if (width >= parseToNumberValue('MIN_MEDIUM_DEVICE')) {
14
17
  return 'md';
15
- } else if (width >= (Platform.OS === 'web' ? parseInt(DEVICE_BREAK_POINTS.MIN_SMALL_DEVICE) : parseInt(DEVICE_BREAK_POINTS_NATIVE_MOBILE.MIN_SMALL_DEVICE))) {
18
+ } else if (width >= parseToNumberValue('MIN_SMALL_DEVICE')) {
16
19
  return 'sm';
17
20
  } else {
18
21
  return 'xs';
@@ -1 +1 @@
1
- {"version":3,"names":["_viewPort","DEVICE_BREAK_POINTS","DEVICE_BREAK_POINTS_NATIVE_MOBILE","Platform","getCurrentBreakpoint","width","OS","parseInt","MIN_LARGE_DEVICE","MIN_MEDIUM_DEVICE","MIN_SMALL_DEVICE","getNumberOfColumnsFromResponsiveConfig","responsiveConfig","currentBreakpoint","fallback","_ref","_value","breakpoint","value","fallbackOrder","currentIndex","indexOf","i","fallbackBreakpoint","xs"],"sources":["responsive.utils.ts"],"sourcesContent":["import _viewPort from './viewport';\nimport { DEVICE_BREAK_POINTS, DEVICE_BREAK_POINTS_NATIVE_MOBILE } from '../styles/theme';\nimport { Platform } from 'react-native';\n\nexport type ResponsiveBreakpoint = 'xs' | 'sm' | 'md' | 'lg';\n\nexport type ResponsiveConfig<T> = {\n xs?: T;\n sm?: T;\n md?: T;\n lg?: T;\n};\n\n/**\n * Determines the current responsive breakpoint based on viewport width and pixel ratio\n * @returns The current breakpoint ('xs' | 'sm' | 'md' | 'lg')\n * \n */\nexport const getCurrentBreakpoint = (): ResponsiveBreakpoint => {\n const width = _viewPort.width;\n \n if (width >= (Platform.OS === 'web' ? parseInt(DEVICE_BREAK_POINTS.MIN_LARGE_DEVICE) : parseInt(DEVICE_BREAK_POINTS_NATIVE_MOBILE.MIN_LARGE_DEVICE))) {\n return 'lg';\n } else if (width >= (Platform.OS === 'web' ? parseInt(DEVICE_BREAK_POINTS.MIN_MEDIUM_DEVICE) : parseInt(DEVICE_BREAK_POINTS_NATIVE_MOBILE.MIN_MEDIUM_DEVICE))) {\n return 'md';\n } else if (width >= (Platform.OS === 'web' ? parseInt(DEVICE_BREAK_POINTS.MIN_SMALL_DEVICE) : parseInt(DEVICE_BREAK_POINTS_NATIVE_MOBILE.MIN_SMALL_DEVICE))) {\n return 'sm';\n } else {\n return 'xs';\n }\n};\n\n/**\n * Gets responsive value for current breakpoint with safe mobile-first fallback\n * The fallback order is: current breakpoint -> smaller breakpoints -> xs (ultimate fallback)\n * \n * @param responsiveConfig Object containing values for each breakpoint (xs, sm, md, lg)\n * @param currentBreakpoint Current breakpoint (optional, will be auto-detected if not provided)\n * @returns The value for current breakpoint or fallback value\n * \n */\nexport const getNumberOfColumnsFromResponsiveConfig = (\n responsiveConfig: ResponsiveConfig<number>,\n currentBreakpoint?: ResponsiveBreakpoint,\n fallback: boolean = false\n): number => {\n const breakpoint = currentBreakpoint || getCurrentBreakpoint();\n \n let value = responsiveConfig[breakpoint];\n \n if (!value && fallback) {\n const fallbackOrder = ['lg', 'md', 'sm', 'xs'];\n const currentIndex = fallbackOrder.indexOf(breakpoint);\n \n for (let i = currentIndex - 1; i >= 0; i--) {\n const fallbackBreakpoint = fallbackOrder[i] as keyof typeof responsiveConfig;\n if (responsiveConfig[fallbackBreakpoint]) {\n value = responsiveConfig[fallbackBreakpoint];\n break;\n }\n }\n }\n \n return value ?? responsiveConfig.xs ?? 1;\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,SAASC,mBAAmB,EAAEC,iCAAiC,QAAQ,iBAAiB;AACxF,SAASC,QAAQ,QAAQ,cAAc;AAWvC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAA4B;EAC9D,MAAMC,KAAK,GAAGL,SAAS,CAACK,KAAK;EAE7B,IAAIA,KAAK,KAAKF,QAAQ,CAACG,EAAE,KAAK,KAAK,GAAGC,QAAQ,CAACN,mBAAmB,CAACO,gBAAgB,CAAC,GAAGD,QAAQ,CAACL,iCAAiC,CAACM,gBAAgB,CAAC,CAAC,EAAE;IACpJ,OAAO,IAAI;EACb,CAAC,MAAM,IAAIH,KAAK,KAAKF,QAAQ,CAACG,EAAE,KAAK,KAAK,GAAGC,QAAQ,CAACN,mBAAmB,CAACQ,iBAAiB,CAAC,GAAGF,QAAQ,CAACL,iCAAiC,CAACO,iBAAiB,CAAC,CAAC,EAAE;IAC7J,OAAO,IAAI;EACb,CAAC,MAAM,IAAIJ,KAAK,KAAKF,QAAQ,CAACG,EAAE,KAAK,KAAK,GAAGC,QAAQ,CAACN,mBAAmB,CAACS,gBAAgB,CAAC,GAAGH,QAAQ,CAACL,iCAAiC,CAACQ,gBAAgB,CAAC,CAAC,EAAE;IAC3J,OAAO,IAAI;EACb,CAAC,MAAM;IACL,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sCAAsC,GAAGA,CACpDC,gBAA0C,EAC1CC,iBAAwC,EACxCC,QAAiB,GAAG,KAAK,KACd;EAAA,IAAAC,IAAA,EAAAC,MAAA;EACX,MAAMC,UAAU,GAAGJ,iBAAiB,IAAIT,oBAAoB,CAAC,CAAC;EAE9D,IAAIc,KAAK,GAAGN,gBAAgB,CAACK,UAAU,CAAC;EAExC,IAAI,CAACC,KAAK,IAAIJ,QAAQ,EAAE;IACtB,MAAMK,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IAC9C,MAAMC,YAAY,GAAGD,aAAa,CAACE,OAAO,CAACJ,UAAU,CAAC;IAEtD,KAAK,IAAIK,CAAC,GAAGF,YAAY,GAAG,CAAC,EAAEE,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;MAC1C,MAAMC,kBAAkB,GAAGJ,aAAa,CAACG,CAAC,CAAkC;MAC5E,IAAIV,gBAAgB,CAACW,kBAAkB,CAAC,EAAE;QACxCL,KAAK,GAAGN,gBAAgB,CAACW,kBAAkB,CAAC;QAC5C;MACF;IACF;EACF;EAEA,QAAAR,IAAA,IAAAC,MAAA,GAAOE,KAAK,cAAAF,MAAA,cAAAA,MAAA,GAAIJ,gBAAgB,CAACY,EAAE,cAAAT,IAAA,cAAAA,IAAA,GAAI,CAAC;AAC1C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_viewPort","getBreakPointValue","parseToNumberValue","name","parseInt","replace","getCurrentBreakpoint","width","getNumberOfColumnsFromResponsiveConfig","responsiveConfig","currentBreakpoint","fallback","_ref","_value","breakpoint","value","fallbackOrder","currentIndex","indexOf","i","fallbackBreakpoint","xs"],"sources":["responsive.utils.ts"],"sourcesContent":["import _viewPort from './viewport';\nimport { getBreakPointValue } from '../styles/theme';\n\nexport type ResponsiveBreakpoint = 'xs' | 'sm' | 'md' | 'lg';\n\nexport type ResponsiveConfig<T> = {\n xs?: T;\n sm?: T;\n md?: T;\n lg?: T;\n};\n\nconst parseToNumberValue = (name: string) => {\n return parseInt(getBreakPointValue(name).replace('px', ''));\n}\n\n/**\n * Determines the current responsive breakpoint based on viewport width and pixel ratio\n * @returns The current breakpoint ('xs' | 'sm' | 'md' | 'lg')\n * \n */\nexport const getCurrentBreakpoint = (): ResponsiveBreakpoint => {\n const width = _viewPort.width;\n if (width >= parseToNumberValue('MIN_LARGE_DEVICE')) {\n return 'lg';\n } else if (width >= parseToNumberValue('MIN_MEDIUM_DEVICE')) {\n return 'md';\n } else if (width >= parseToNumberValue('MIN_SMALL_DEVICE')) {\n return 'sm';\n } else {\n return 'xs';\n }\n};\n\n/**\n * Gets responsive value for current breakpoint with safe mobile-first fallback\n * The fallback order is: current breakpoint -> smaller breakpoints -> xs (ultimate fallback)\n * \n * @param responsiveConfig Object containing values for each breakpoint (xs, sm, md, lg)\n * @param currentBreakpoint Current breakpoint (optional, will be auto-detected if not provided)\n * @returns The value for current breakpoint or fallback value\n * \n */\nexport const getNumberOfColumnsFromResponsiveConfig = (\n responsiveConfig: ResponsiveConfig<number>,\n currentBreakpoint?: ResponsiveBreakpoint,\n fallback: boolean = false\n): number => {\n const breakpoint = currentBreakpoint || getCurrentBreakpoint();\n\n let value = responsiveConfig[breakpoint];\n \n if (!value && fallback) {\n const fallbackOrder = ['lg', 'md', 'sm', 'xs'];\n const currentIndex = fallbackOrder.indexOf(breakpoint);\n \n for (let i = currentIndex - 1; i >= 0; i--) {\n const fallbackBreakpoint = fallbackOrder[i] as keyof typeof responsiveConfig;\n if (responsiveConfig[fallbackBreakpoint]) {\n value = responsiveConfig[fallbackBreakpoint];\n break;\n }\n }\n }\n \n return value ?? responsiveConfig.xs ?? 1;\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,SAASC,kBAAkB,QAAQ,iBAAiB;AAWpD,MAAMC,kBAAk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CAACW,kBAAkB,CAAC,EAAE;QACxCL,KAAK,GAAGN,gBAAgB,CAACW,kBAAkB,CAAC;QAC5C;MACF;IACF;EACF;EAEA,QAAAR,IAAA,IAAAC,MAAA,GAAOE,KAAK,cAAAF,MAAA,cAAAA,MAAA,GAAIJ,gBAAgB,CAACY,EAAE,cAAAT,IAAA,cAAAA,IAAA,GAAI,CAAC;AAC1C,CAAC","ignoreList":[]}
@@ -0,0 +1,50 @@
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 React from "react";
5
+ import Animated from "react-native-reanimated";
6
+ import { StickyWrapper } from "./sticky-wrapper";
7
+ // StyickyComponentContext is used for the UI, stickyNav & stickyContainer components will be attached here.
8
+ export const StickyComponentsContext = /*#__PURE__*/React.createContext(null);
9
+ export class StickyViewComponents extends React.Component {
10
+ constructor(...args) {
11
+ super(...args);
12
+ _defineProperty(this, "children", new Map());
13
+ _defineProperty(this, "id", 0);
14
+ }
15
+ add(c, n) {
16
+ this.children.set(c, n);
17
+ setTimeout(() => this.setState({
18
+ id: ++this.id
19
+ }));
20
+ }
21
+ remove(c) {
22
+ this.children.delete(c);
23
+ setTimeout(() => this.setState({
24
+ id: ++this.id
25
+ }));
26
+ }
27
+ render() {
28
+ return /*#__PURE__*/React.createElement(StickyComponentsContext.Provider, {
29
+ value: this
30
+ }, /*#__PURE__*/React.createElement(StickyWrapper, {
31
+ hasAppnavbar: this.props.hasAppnavbar,
32
+ onscroll: this.props.onscroll,
33
+ notifier: this.props.notifier
34
+ }, this.props.children, /*#__PURE__*/React.createElement(Animated.View, {
35
+ style: {
36
+ position: 'absolute',
37
+ width: '100%',
38
+ zIndex: 10
39
+ },
40
+ pointerEvents: 'box-none'
41
+ }, Array.from(this.children.entries()).map(([view, node]) => {
42
+ const element = node;
43
+ return /*#__PURE__*/React.cloneElement(element, {
44
+ key: `sticky-${view.id}`,
45
+ style: element.props.style
46
+ });
47
+ }))));
48
+ }
49
+ }
50
+ //# sourceMappingURL=sticky-view.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Animated","StickyWrapper","StickyComponentsContext","createContext","StickyViewComponents","Component","constructor","args","_defineProperty","Map","add","c","n","children","set","setTimeout","setState","id","remove","delete","render","createElement","Provider","value","hasAppnavbar","props","onscroll","notifier","View","style","position","width","zIndex","pointerEvents","Array","from","entries","map","view","node","element","cloneElement","key"],"sources":["sticky-view.component.tsx"],"sourcesContent":["import React, { \n ReactNode, \n useContext, \n RefObject,\n Dispatch,\n SetStateAction,\n } from \"react\";\nimport { ViewStyle, NativeSyntheticEvent, NativeScrollEvent, LayoutRectangle } from \"react-native\";\nimport Animated, {\n useSharedValue,\n useAnimatedStyle,\n useAnimatedScrollHandler,\n runOnJS,\n ReanimatedEvent,\n ScrollEvent,\n AnimatedStyle,\n} from \"react-native-reanimated\";\nimport { BaseComponent, BaseComponentState, BaseProps, BaseStyles } from \"./base.component\";\nimport { SharedValue } from 'react-native-reanimated';\nimport EventNotifier from \"./event-notifier\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport { StickyBaseView } from \"./components/sticky-base.component\";\nimport { StickyWrapper } from \"./sticky-wrapper\";\n\nexport interface StickyViewComponentsProps {\n stickyNavAnimateStyle?: AnimatedStyle;\n stickyContainerAnimateStyle?: AnimatedStyle;\n children?: ReactNode;\n hasAppnavbar?: boolean;\n onscroll?: string;\n notifier: EventNotifier;\n}\n\n// StyickyComponentContext is used for the UI, stickyNav & stickyContainer components will be attached here.\nexport const StickyComponentsContext = React.createContext<StickyViewComponents>(null as any);\n\nexport class StickyViewComponents extends React.Component<StickyViewComponentsProps, any, any> {\n children: Map<StickyBaseView, React.ReactNode> = new Map();\n id = 0;\n\n add(c: StickyBaseView, n: React.ReactNode) {\n this.children.set(c, n);\n setTimeout(() => this.setState({ id: ++this.id }));\n }\n\n remove(c: StickyBaseView) {\n this.children.delete(c);\n setTimeout(() => this.setState({ id: ++this.id }));\n }\n\n render() {\n return (\n <StickyComponentsContext.Provider value={this}>\n <StickyWrapper hasAppnavbar={this.props.hasAppnavbar} onscroll={this.props.onscroll} notifier={this.props.notifier}>\n {(this.props as any).children}\n <Animated.View style={{ position: 'absolute', width: '100%', zIndex: 10 }} pointerEvents={'box-none'}>\n {Array.from(this.children.entries()).map(([view, node]) => {\n const element = node as React.ReactElement;\n return React.cloneElement(element, { \n key: `sticky-${view.id}`,\n style: element.props.style\n });\n })}\n </Animated.View>\n </StickyWrapper>\n </StickyComponentsContext.Provider>\n );\n }\n}"],"mappings":";;;AAAA,OAAOA,KAAK,MAMJ,OAAO;AAEf,OAAOC,QAAQ,MAQR,yBAAyB;AAQhC,SAASC,aAAa,QAAQ,kBAAkB;AAWhD;AACA,OAAO,MAAMC,uBAAuB,gBAAGH,KAAK,CAACI,aAAa,CAAuB,IAAW,CAAC;AAE7F,OAAO,MAAMC,oBAAoB,SAASL,KAAK,CAACM,SAAS,CAAsC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBAC5C,IAAIC,GAAG,CAAC,CAAC;IAAAD,eAAA,aACrD,CAAC;EAAA;EAENE,GAAGA,CAACC,CAAiB,EAAEC,CAAkB,EAAE;IACzC,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACH,CAAC,EAAEC,CAAC,CAAC;IACvBG,UAAU,CAAC,MAAM,IAAI,CAACC,QAAQ,C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@
1
+ import React from "react";
2
+ import { runOnJS, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
3
+ import injector from "./injector";
4
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
5
+
6
+ // StickyWrapperContext is used for the usage & passing of hooks in StickyWrapper(functional component) to childrens.
7
+ export const StickyWrapperContext = /*#__PURE__*/React.createContext(undefined);
8
+ export const StickyWrapper = ({
9
+ children,
10
+ hasAppnavbar,
11
+ onscroll,
12
+ notifier
13
+ }) => {
14
+ var _appConfig$edgeToEdge;
15
+ const appConfig = injector.get('APP_CONFIG');
16
+ const scrollY = useSharedValue(0);
17
+ const prevScrollY = useSharedValue(0);
18
+ const scrollVelocity = useSharedValue(0);
19
+ const scrollDirection = useSharedValue(0);
20
+ const stickyContainerTranslateY = useSharedValue(0);
21
+ const stickyNavTranslateY = useSharedValue(0);
22
+
23
+ // Default navbar height from appnavbar styles is 80, maintaining this to minimize the navHeight immediate flicker (in page-content paddingTop)
24
+ const insets = useSafeAreaInsets();
25
+ const insetsVal = appConfig !== null && appConfig !== void 0 && (_appConfig$edgeToEdge = appConfig.edgeToEdgeConfig) !== null && _appConfig$edgeToEdge !== void 0 && _appConfig$edgeToEdge.isEdgeToEdgeApp ? insets === null || insets === void 0 ? void 0 : insets.top : 0;
26
+ const navHeight = useSharedValue(hasAppnavbar && (onscroll == 'topnav' || onscroll == 'topnav-bottomnav') ? 80 + insetsVal : 0);
27
+ const bottomTabHeight = useSharedValue(0);
28
+ const lastNotifyTime = useSharedValue(0);
29
+ const prevScrollTime = useSharedValue(0);
30
+ const stickyNavAnimateStyle = useAnimatedStyle(() => {
31
+ return {
32
+ transform: [{
33
+ translateY: -stickyNavTranslateY.value
34
+ }]
35
+ };
36
+ }, [stickyNavTranslateY]);
37
+ const stickyContainerAnimateStyle = useAnimatedStyle(() => {
38
+ const stickyNav = onscroll == 'topnav' || onscroll == 'topnav-bottomnav';
39
+ if (stickyNav) {
40
+ return {
41
+ transform: [{
42
+ translateY: Math.max(Math.max(stickyContainerTranslateY.value - navHeight.value - scrollY.value, -navHeight.value), -stickyNavTranslateY.value)
43
+ }]
44
+ };
45
+ } else {
46
+ return {
47
+ transform: [{
48
+ translateY: Math.max(stickyContainerTranslateY.value - scrollY.value, navHeight.value)
49
+ }]
50
+ };
51
+ }
52
+ }, [scrollY, stickyContainerTranslateY, navHeight, stickyNavTranslateY]);
53
+ const notifyEvent = event => {
54
+ if (notifier) {
55
+ notifier.notify('scroll', [{
56
+ nativeEvent: event
57
+ }]);
58
+ }
59
+ };
60
+ const onScroll = useAnimatedScrollHandler({
61
+ onScroll: event => {
62
+ var _event$contentOffset;
63
+ const y = (_event$contentOffset = event.contentOffset) === null || _event$contentOffset === void 0 ? void 0 : _event$contentOffset.y;
64
+ const currentScrollTime = Date.now();
65
+ const delta = y - prevScrollY.value;
66
+ const delaTime = currentScrollTime - prevScrollTime.value;
67
+ if (delta != 0) scrollDirection.value = delta > 0 ? -1 : 1;
68
+ if (Math.abs(delta) >= 0.1) {
69
+ prevScrollY.value = y;
70
+ scrollY.value = Math.max(0, y);
71
+ stickyNavTranslateY.value = Math.max(Math.min(stickyNavTranslateY.value + delta, navHeight.value), 0);
72
+ scrollVelocity.value = Math.abs(delta) / delaTime;
73
+ prevScrollTime.value = currentScrollTime;
74
+ }
75
+ if (currentScrollTime - lastNotifyTime.value >= 100) {
76
+ var _event$contentOffset$, _event$contentOffset2, _event$contentSize$he, _event$contentSize, _event$layoutMeasurem, _event$layoutMeasurem2;
77
+ lastNotifyTime.value = currentScrollTime;
78
+ const safeEvent = {
79
+ contentOffset: {
80
+ y: (_event$contentOffset$ = (_event$contentOffset2 = event.contentOffset) === null || _event$contentOffset2 === void 0 ? void 0 : _event$contentOffset2.y) !== null && _event$contentOffset$ !== void 0 ? _event$contentOffset$ : 0
81
+ },
82
+ contentSize: {
83
+ height: (_event$contentSize$he = (_event$contentSize = event.contentSize) === null || _event$contentSize === void 0 ? void 0 : _event$contentSize.height) !== null && _event$contentSize$he !== void 0 ? _event$contentSize$he : 0
84
+ },
85
+ layoutMeasurement: {
86
+ height: (_event$layoutMeasurem = (_event$layoutMeasurem2 = event.layoutMeasurement) === null || _event$layoutMeasurem2 === void 0 ? void 0 : _event$layoutMeasurem2.height) !== null && _event$layoutMeasurem !== void 0 ? _event$layoutMeasurem : 0
87
+ },
88
+ scrollDirection: scrollDirection.value,
89
+ scrollDelta: delta
90
+ };
91
+ runOnJS(notifyEvent)(safeEvent);
92
+ }
93
+ }
94
+ });
95
+ const onScrollEndDrag = scrollRef => {
96
+ const y = scrollY.value;
97
+ if (scrollVelocity.value < 0.3) {
98
+ if (scrollDirection.value < 0 && stickyNavTranslateY.value >= navHeight.value / 9.9) {
99
+ var _scrollRef$current;
100
+ // bottom visible
101
+ scrollRef === null || scrollRef === void 0 || (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 || _scrollRef$current.scrollTo({
102
+ y: y + (navHeight.value - stickyNavTranslateY.value),
103
+ animated: true
104
+ });
105
+ } else if (scrollDirection.value > 0 && stickyNavTranslateY.value <= navHeight.value / 1.1) {
106
+ var _scrollRef$current2;
107
+ // top content visible
108
+ scrollRef === null || scrollRef === void 0 || (_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 || _scrollRef$current2.scrollTo({
109
+ y: y - stickyNavTranslateY.value,
110
+ animated: true
111
+ });
112
+ }
113
+ }
114
+ };
115
+ const contextValue = {
116
+ scrollDirection,
117
+ stickyNavAnimateStyle,
118
+ stickyContainerAnimateStyle,
119
+ stickyContainerTranslateY,
120
+ navHeight,
121
+ bottomTabHeight,
122
+ onScroll,
123
+ onScrollEndDrag
124
+ };
125
+ return /*#__PURE__*/React.createElement(StickyWrapperContext.Provider, {
126
+ value: contextValue
127
+ }, children);
128
+ };
129
+ //# sourceMappingURL=sticky-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","runOnJS","useAnimatedScrollHandler","useAnimatedStyle","useSharedValue","injector","useSafeAreaInsets","StickyWrapperContext","createContext","undefined","StickyWrapper","children","hasAppnavbar","onscroll","notifier","_appConfig$edgeToEdge","appConfig","get","scrollY","prevScrollY","scrollVelocity","scrollDirection","stickyContainerTranslateY","stickyNavTranslateY","insets","insetsVal","edgeToEdgeConfig","isEdgeToEdgeApp","top","navHeight","bottomTabHeight","lastNotifyTime","prevScrollTime","stickyNavAnimateStyle","transform","translateY","value","stickyContainerAnimateStyle","stickyNav","Math","max","notifyEvent","event","notify","nativeEvent","onScroll","_event$contentOffset","y","contentOffset","currentScrollTime","Date","now","delta","delaTime","abs","min","_event$contentOffset$","_event$contentOffset2","_event$contentSize$he","_event$contentSize","_event$layoutMeasurem","_event$layoutMeasurem2","safeEvent","contentSize","height","layoutMeasurement","scrollDelta","onScrollEndDrag","scrollRef","_scrollRef$current","current","scrollTo","animated","_scrollRef$current2","contextValue","createElement","Provider"],"sources":["sticky-wrapper.tsx"],"sourcesContent":["import React, { RefObject } from \"react\";\nimport { NativeScrollEvent, NativeSyntheticEvent } from \"react-native\";\nimport Animated, { AnimatedStyle, ReanimatedEvent, runOnJS, ScrollEvent, SharedValue, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from \"react-native-reanimated\";\nimport { StickyViewComponentsProps } from \"./sticky-view.component\";\nimport injector from \"./injector\";\nimport AppConfig from \"./AppConfig\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\n// StickyWrapperContext is used for the usage & passing of hooks in StickyWrapper(functional component) to childrens.\nexport const StickyWrapperContext = React.createContext<StickyWrapperContextType | undefined>(undefined);\n\nexport type CustomJsScrollEvent = {\n contentOffset: { y: number };\n contentSize: { height: number};\n layoutMeasurement: { height: number};\n scrollDirection: number;\n scrollDelta: number;\n};\n\n\nexport type StickyWrapperContextType = {\n stickyNavTranslateY?: SharedValue<number>;\n stickyContainerTranslateY: SharedValue<number>;\n\n stickyNavAnimateStyle: AnimatedStyle;\n stickyContainerAnimateStyle: AnimatedStyle;\n\n navHeight: SharedValue<number>;\n bottomTabHeight: SharedValue<number>;\n scrollDirection: SharedValue<number>;\n\n onScroll: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\n onScrollEndDrag: (scrollRef: RefObject<Animated.ScrollView>) => void;\n};\n\nexport const StickyWrapper = ({ children, hasAppnavbar, onscroll, notifier }: StickyViewComponentsProps) => {\n const appConfig = injector.get<AppConfig>('APP_CONFIG');\n const scrollY = useSharedValue<number>(0);\n const prevScrollY = useSharedValue<number>(0);\n const scrollVelocity = useSharedValue<number>(0);\n const scrollDirection = useSharedValue<number>(0);\n\n const stickyContainerTranslateY = useSharedValue<number>(0);\n const stickyNavTranslateY = useSharedValue<number>(0);\n\n // Default navbar height from appnavbar styles is 80, maintaining this to minimize the navHeight immediate flicker (in page-content paddingTop)\n const insets = useSafeAreaInsets();\n const insetsVal = appConfig?.edgeToEdgeConfig?.isEdgeToEdgeApp ? insets?.top : 0;\n const navHeight = useSharedValue<number>(hasAppnavbar && (onscroll == 'topnav' || onscroll == 'topnav-bottomnav') ? (80 + insetsVal) : 0);\n const bottomTabHeight = useSharedValue<number>(0);\n\n const lastNotifyTime = useSharedValue<number>(0);\n const prevScrollTime = useSharedValue<number>(0);\n\n const stickyNavAnimateStyle = useAnimatedStyle(() => {\n return {\n transform: [{ translateY: -stickyNavTranslateY.value }]\n };\n }, [stickyNavTranslateY]);\n\n const stickyContainerAnimateStyle = useAnimatedStyle(() => {\n const stickyNav = onscroll == 'topnav' || onscroll == 'topnav-bottomnav';\n if(stickyNav){\n return {\n transform: [{ translateY: \n Math.max(\n Math.max(stickyContainerTranslateY.value - navHeight.value - scrollY.value, - navHeight.value), \n - stickyNavTranslateY.value\n )\n }],\n }\n }else{\n return {\n transform: [{ translateY: Math.max(stickyContainerTranslateY.value - scrollY.value, navHeight.value)}]\n }\n }\n }, [scrollY, stickyContainerTranslateY, navHeight, stickyNavTranslateY]);\n\n const notifyEvent = (event: CustomJsScrollEvent)=>{\n if(notifier) {\n notifier.notify('scroll', [{nativeEvent: event}]);\n }\n }\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: (event: ReanimatedEvent<ScrollEvent>): void => {\n const y = event.contentOffset?.y;\n const currentScrollTime = Date.now();\n\n const delta = y - prevScrollY.value;\n const delaTime = currentScrollTime - prevScrollTime.value;\n if(delta != 0) scrollDirection.value = delta > 0 ? -1 : 1;\n\n if (Math.abs(delta) >= 0.1){\n prevScrollY.value = y;\n scrollY.value = Math.max(0, y);\n\n stickyNavTranslateY.value = Math.max(Math.min(stickyNavTranslateY.value + delta, navHeight.value), 0);\n\n scrollVelocity.value = Math.abs(delta) / delaTime;\n prevScrollTime.value = currentScrollTime;\n }\n\n if(currentScrollTime - lastNotifyTime.value >= 100){\n lastNotifyTime.value = currentScrollTime;\n const safeEvent = {\n contentOffset: {\n y: event.contentOffset?.y ?? 0,\n },\n contentSize: {\n height: event.contentSize?.height ?? 0,\n },\n layoutMeasurement: {\n height: event.layoutMeasurement?.height ?? 0,\n },\n scrollDirection: scrollDirection.value,\n scrollDelta: delta,\n };\n runOnJS(notifyEvent)(safeEvent);\n }\n }\n });\n\n const onScrollEndDrag = (scrollRef: RefObject<Animated.ScrollView>): void =>{\n const y = scrollY.value;\n if(scrollVelocity.value < 0.3){\n if(scrollDirection.value < 0 && stickyNavTranslateY.value >= (navHeight.value / 9.9)){ // bottom visible\n scrollRef?.current?.scrollTo({ y: y + (navHeight.value - stickyNavTranslateY.value), animated: true })\n } else if( scrollDirection.value > 0 && stickyNavTranslateY.value <= (navHeight.value / 1.1)) { // top content visible\n scrollRef?.current?.scrollTo({ y: y - stickyNavTranslateY.value, animated: true })\n }\n }\n }\n\n const contextValue = {\n scrollDirection,\n stickyNavAnimateStyle,\n stickyContainerAnimateStyle,\n stickyContainerTranslateY,\n navHeight,\n bottomTabHeight, \n onScroll,\n onScrollEndDrag\n };\n\n return (\n <StickyWrapperContext.Provider value={contextValue}>\n {children}\n </StickyWrapperContext.Provider>\n );\n};"],"mappings":"AAAA,OAAOA,KA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AK,GAAG,CAAC,IAAKb,mBAAmB,CAACa,KAAK,IAAKP,SAAS,CAACO,KAAK,GAAG,GAAI,EAAE;QAAA,IAAAqC,mBAAA;QAAE;QAC/FL,SAAS,aAATA,SAAS,gBAAAK,mBAAA,GAATL,SAAS,CAAEE,OAAO,cAAAG,mBAAA,eAAlBA,mBAAA,CAAoBF,QAAQ,CAAC;UAAExB,CAAC,EAAEA,CAAC,GAAGxB,mBAAmB,CAACa,KAAK;UAAEoC,QAAQ,EAAE;QAAK,CAAC,CAAC;MACpF;IACF;EACF,CAAC;EAED,MAAME,YAAY,GAAG;IACnBrD,eAAe;IACfY,qBAAqB;IACrBI,2BAA2B;IAC3Bf,yBAAyB;IACzBO,SAAS;IACTC,eAAe;IACfe,QAAQ;IACRsB;EACF,CAAC;EAED,oBACEnE,KAAA,CAAA2E,aAAA,CAACpE,oBAAoB,CAACqE,QAAQ;IAACxC,KAAK,EAAEsC;EAAa,GAChD/D,QAC4B,CAAC;AAEpC,CAAC","ignoreList":[]}
package/core/utils.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { Platform } from 'react-native';
2
2
  import moment from "moment";
3
- import * as FileSystem from "expo-file-system";
4
3
  import { isFunction, includes, isUndefined, isNull, orderBy, groupBy, toLower, get, forEach, sortBy, cloneDeep, keys, values, isArray, isString, isNumber } from 'lodash';
5
4
  import * as mime from 'react-native-mime-types';
6
5
  import ThemeVariables from '../styles/theme.variables';
@@ -329,11 +328,6 @@ export const formatCompactNumber = number => {
329
328
  }
330
329
  return (isNegative ? '-' : '') + formattedNumber;
331
330
  };
332
- export const toBase64 = function (path) {
333
- return FileSystem.readAsStringAsync(path, {
334
- encoding: 'base64'
335
- });
336
- };
337
331
  const DATASET_WIDGETS = new Set(['select', 'checkboxset', 'radioset', 'switch', 'autocomplete', 'chips', 'typeahead', 'rating']);
338
332
  export const isDataSetWidget = widget => {
339
333
  return DATASET_WIDGETS.has(widget);