@plusscommunities/pluss-core-app 8.0.0 → 8.0.1-auth.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/dist/module/actions/FollowerActions.js +4 -4
  2. package/dist/module/actions/FollowerActions.js.map +1 -1
  3. package/dist/module/actions/MediaActions.js +1 -1
  4. package/dist/module/actions/MediaActions.js.map +1 -1
  5. package/dist/module/actions/ResidentActions.js +1 -1
  6. package/dist/module/actions/ResidentActions.js.map +1 -1
  7. package/dist/module/actions/UserActions.js +1 -1
  8. package/dist/module/actions/UserActions.js.map +1 -1
  9. package/dist/module/actions/UserSettingsActions.js +1 -1
  10. package/dist/module/actions/UserSettingsActions.js.map +1 -1
  11. package/dist/module/actions/index.js +5 -5
  12. package/dist/module/actions/index.js.map +1 -1
  13. package/dist/module/actions/types.js +16 -16
  14. package/dist/module/actions/types.js.map +1 -1
  15. package/dist/module/apis/analyticsActions.js +5 -5
  16. package/dist/module/apis/analyticsActions.js.map +1 -1
  17. package/dist/module/apis/contactActions.js +6 -6
  18. package/dist/module/apis/contactActions.js.map +1 -1
  19. package/dist/module/apis/eventActions.js +28 -28
  20. package/dist/module/apis/eventActions.js.map +1 -1
  21. package/dist/module/apis/fileActions.js +15 -15
  22. package/dist/module/apis/fileActions.js.map +1 -1
  23. package/dist/module/apis/followerActions.js +8 -8
  24. package/dist/module/apis/followerActions.js.map +1 -1
  25. package/dist/module/apis/index.js +12 -12
  26. package/dist/module/apis/index.js.map +1 -1
  27. package/dist/module/apis/notificationActions.js +17 -17
  28. package/dist/module/apis/notificationActions.js.map +1 -1
  29. package/dist/module/apis/profileActions.js +4 -4
  30. package/dist/module/apis/profileActions.js.map +1 -1
  31. package/dist/module/apis/reactionActions.js +15 -15
  32. package/dist/module/apis/reactionActions.js.map +1 -1
  33. package/dist/module/apis/settingActions.js +6 -6
  34. package/dist/module/apis/settingActions.js.map +1 -1
  35. package/dist/module/apis/stringActions.js +8 -8
  36. package/dist/module/apis/stringActions.js.map +1 -1
  37. package/dist/module/apis/typeActions.js +4 -4
  38. package/dist/module/apis/typeActions.js.map +1 -1
  39. package/dist/module/apis/userActions.js +8 -8
  40. package/dist/module/apis/userActions.js.map +1 -1
  41. package/dist/module/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
  42. package/dist/module/assets/icons/fontawesome/fa-light-300.ttf +0 -0
  43. package/dist/module/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
  44. package/dist/module/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
  45. package/dist/module/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
  46. package/dist/module/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
  47. package/dist/module/colours.js +26 -29
  48. package/dist/module/colours.js.map +1 -1
  49. package/dist/module/components/AddButton.js +8 -8
  50. package/dist/module/components/AddButton.js.map +1 -1
  51. package/dist/module/components/AddToCalendarButton.js +30 -29
  52. package/dist/module/components/AddToCalendarButton.js.map +1 -1
  53. package/dist/module/components/Attachment.js +10 -9
  54. package/dist/module/components/Attachment.js.map +1 -1
  55. package/dist/module/components/AudienceSelectorLauncher.js +11 -11
  56. package/dist/module/components/AudienceSelectorLauncher.js.map +1 -1
  57. package/dist/module/components/AudienceSelectorPage.js +45 -44
  58. package/dist/module/components/AudienceSelectorPage.js.map +1 -1
  59. package/dist/module/components/AutoOffsetImage.js +13 -13
  60. package/dist/module/components/AutoOffsetImage.js.map +1 -1
  61. package/dist/module/components/BackButton.js +10 -10
  62. package/dist/module/components/BackButton.js.map +1 -1
  63. package/dist/module/components/CalendarPopup.js +21 -21
  64. package/dist/module/components/CalendarPopup.js.map +1 -1
  65. package/dist/module/components/CategoryTabs.js +30 -29
  66. package/dist/module/components/CategoryTabs.js.map +1 -1
  67. package/dist/module/components/CommentReply.js +43 -37
  68. package/dist/module/components/CommentReply.js.map +1 -1
  69. package/dist/module/components/CommentSection.js +74 -74
  70. package/dist/module/components/CommentSection.js.map +1 -1
  71. package/dist/module/components/ConfirmPopup.js +21 -20
  72. package/dist/module/components/ConfirmPopup.js.map +1 -1
  73. package/dist/module/components/ConfirmationPopup.js +11 -11
  74. package/dist/module/components/ConfirmationPopup.js.map +1 -1
  75. package/dist/module/components/DocumentUploader.js +50 -50
  76. package/dist/module/components/DocumentUploader.js.map +1 -1
  77. package/dist/module/components/DropDownItem.js +14 -13
  78. package/dist/module/components/DropDownItem.js.map +1 -1
  79. package/dist/module/components/DropDownMenu.js +5 -5
  80. package/dist/module/components/DropDownMenu.js.map +1 -1
  81. package/dist/module/components/EmptyStateMain.js +10 -9
  82. package/dist/module/components/EmptyStateMain.js.map +1 -1
  83. package/dist/module/components/EmptyStateWidget.js +7 -6
  84. package/dist/module/components/EmptyStateWidget.js.map +1 -1
  85. package/dist/module/components/FontScaleButton.js +5 -4
  86. package/dist/module/components/FontScaleButton.js.map +1 -1
  87. package/dist/module/components/FontScalePopup.js +11 -10
  88. package/dist/module/components/FontScalePopup.js.map +1 -1
  89. package/dist/module/components/Forbidden.js +13 -13
  90. package/dist/module/components/Forbidden.js.map +1 -1
  91. package/dist/module/components/FormCard.js +4 -4
  92. package/dist/module/components/FormCard.js.map +1 -1
  93. package/dist/module/components/FormCardSection.js +20 -18
  94. package/dist/module/components/FormCardSection.js.map +1 -1
  95. package/dist/module/components/FormCardSectionOptionLauncher.js +13 -12
  96. package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -1
  97. package/dist/module/components/FormattedText.js +18 -16
  98. package/dist/module/components/FormattedText.js.map +1 -1
  99. package/dist/module/components/GenericInput.js +24 -21
  100. package/dist/module/components/GenericInput.js.map +1 -1
  101. package/dist/module/components/GenericInputSection.js +27 -26
  102. package/dist/module/components/GenericInputSection.js.map +1 -1
  103. package/dist/module/components/Header.js +70 -69
  104. package/dist/module/components/Header.js.map +1 -1
  105. package/dist/module/components/Icon.js +109 -0
  106. package/dist/module/components/Icon.js.map +1 -0
  107. package/dist/module/components/ImagePopup.js +211 -73
  108. package/dist/module/components/ImagePopup.js.map +1 -1
  109. package/dist/module/components/ImageUploadProgress.js +10 -9
  110. package/dist/module/components/ImageUploadProgress.js.map +1 -1
  111. package/dist/module/components/ImageUploader.js +116 -96
  112. package/dist/module/components/ImageUploader.js.map +1 -1
  113. package/dist/module/components/InlineButton.js +9 -8
  114. package/dist/module/components/InlineButton.js.map +1 -1
  115. package/dist/module/components/Input.js +28 -26
  116. package/dist/module/components/Input.js.map +1 -1
  117. package/dist/module/components/LoadingCircles.js +20 -20
  118. package/dist/module/components/LoadingCircles.js.map +1 -1
  119. package/dist/module/components/LoadingIndicator.js +11 -11
  120. package/dist/module/components/LoadingIndicator.js.map +1 -1
  121. package/dist/module/components/LoadingStateWidget.js +5 -5
  122. package/dist/module/components/LoadingStateWidget.js.map +1 -1
  123. package/dist/module/components/MediaPlayer.js +31 -31
  124. package/dist/module/components/MediaPlayer.js.map +1 -1
  125. package/dist/module/components/MiddlePopup.js +17 -11
  126. package/dist/module/components/MiddlePopup.js.map +1 -1
  127. package/dist/module/components/PDFPopup.js +52 -39
  128. package/dist/module/components/PDFPopup.js.map +1 -1
  129. package/dist/module/components/PlussChat.js +168 -149
  130. package/dist/module/components/PlussChat.js.map +1 -1
  131. package/dist/module/components/PlussChatMessage.js +42 -42
  132. package/dist/module/components/PlussChatMessage.js.map +1 -1
  133. package/dist/module/components/PlussChatTime.js +18 -17
  134. package/dist/module/components/PlussChatTime.js.map +1 -1
  135. package/dist/module/components/Popup.js +20 -19
  136. package/dist/module/components/Popup.js.map +1 -1
  137. package/dist/module/components/PopupMenu.js +15 -14
  138. package/dist/module/components/PopupMenu.js.map +1 -1
  139. package/dist/module/components/PositionedImage.js +20 -20
  140. package/dist/module/components/PositionedImage.js.map +1 -1
  141. package/dist/module/components/ProfilePic.js +10 -10
  142. package/dist/module/components/ProfilePic.js.map +1 -1
  143. package/dist/module/components/RadioButton.js +10 -9
  144. package/dist/module/components/RadioButton.js.map +1 -1
  145. package/dist/module/components/Reaction.js +18 -17
  146. package/dist/module/components/Reaction.js.map +1 -1
  147. package/dist/module/components/Reactions.js +7 -7
  148. package/dist/module/components/Reactions.js.map +1 -1
  149. package/dist/module/components/SharingTools.js +78 -43
  150. package/dist/module/components/SharingTools.js.map +1 -1
  151. package/dist/module/components/Spinner.js +5 -5
  152. package/dist/module/components/Spinner.js.map +1 -1
  153. package/dist/module/components/StickyFooter.js +6 -6
  154. package/dist/module/components/StickyFooter.js.map +1 -1
  155. package/dist/module/components/Text.js +57 -0
  156. package/dist/module/components/Text.js.map +1 -0
  157. package/dist/module/components/TickIcon.js +6 -6
  158. package/dist/module/components/TickIcon.js.map +1 -1
  159. package/dist/module/components/Toggle.js +10 -9
  160. package/dist/module/components/Toggle.js.map +1 -1
  161. package/dist/module/components/TouchableSearchBar.js +18 -17
  162. package/dist/module/components/TouchableSearchBar.js.map +1 -1
  163. package/dist/module/components/UserListPopup.js +20 -19
  164. package/dist/module/components/UserListPopup.js.map +1 -1
  165. package/dist/module/components/UserListing.js +41 -40
  166. package/dist/module/components/UserListing.js.map +1 -1
  167. package/dist/module/components/VideoPopup.js +20 -20
  168. package/dist/module/components/VideoPopup.js.map +1 -1
  169. package/dist/module/components/WarningPopup.js +21 -20
  170. package/dist/module/components/WarningPopup.js.map +1 -1
  171. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +13 -13
  172. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -1
  173. package/dist/module/components/expo-image-picker-multiple/ImageTile.js +24 -23
  174. package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -1
  175. package/dist/module/components/index.js +59 -58
  176. package/dist/module/components/index.js.map +1 -1
  177. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +94 -64
  178. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -1
  179. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +64 -64
  180. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -1
  181. package/dist/module/config.js +15 -10
  182. package/dist/module/config.js.map +1 -1
  183. package/dist/module/constants.js +3 -4
  184. package/dist/module/constants.js.map +1 -1
  185. package/dist/module/helper.js +83 -82
  186. package/dist/module/helper.js.map +1 -1
  187. package/dist/module/index.js +12 -12
  188. package/dist/module/index.js.map +1 -1
  189. package/dist/module/js/images/detectFaces.js +11 -10
  190. package/dist/module/js/images/detectFaces.js.map +1 -1
  191. package/dist/module/js/images/findLandmarkRange.js +8 -8
  192. package/dist/module/js/images/findLandmarkRange.js.map +1 -1
  193. package/dist/module/js/images/getScaledOffset.js.map +1 -1
  194. package/dist/module/js/site/getSiteLevelFromState.js +2 -2
  195. package/dist/module/js/site/getSiteLevelFromState.js.map +1 -1
  196. package/dist/module/js/site/isTVEnabled.js +2 -2
  197. package/dist/module/js/site/isTVEnabled.js.map +1 -1
  198. package/dist/module/session.js +6 -6
  199. package/dist/module/session.js.map +1 -1
  200. package/dist/module/styles.js +17 -17
  201. package/dist/module/styles.js.map +1 -1
  202. package/dist/module/withNavigationFocus.js +30 -0
  203. package/dist/module/withNavigationFocus.js.map +1 -0
  204. package/package.json +71 -68
  205. package/src/actions/FollowerActions.js +36 -32
  206. package/src/actions/MediaActions.js +25 -20
  207. package/src/actions/ResidentActions.js +26 -21
  208. package/src/actions/UserActions.js +22 -22
  209. package/src/actions/UserSettingsActions.js +11 -11
  210. package/src/actions/index.js +5 -5
  211. package/src/actions/types.js +16 -16
  212. package/src/apis/analyticsActions.js +17 -17
  213. package/src/apis/contactActions.js +20 -20
  214. package/src/apis/eventActions.js +153 -144
  215. package/src/apis/fileActions.js +96 -86
  216. package/src/apis/followerActions.js +29 -29
  217. package/src/apis/index.js +12 -12
  218. package/src/apis/notificationActions.js +44 -44
  219. package/src/apis/profileActions.js +8 -8
  220. package/src/apis/reactionActions.js +81 -73
  221. package/src/apis/settingActions.js +15 -15
  222. package/src/apis/stringActions.js +29 -25
  223. package/src/apis/typeActions.js +10 -10
  224. package/src/apis/userActions.js +93 -93
  225. package/src/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
  226. package/src/assets/icons/fontawesome/fa-light-300.ttf +0 -0
  227. package/src/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
  228. package/src/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
  229. package/src/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
  230. package/src/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
  231. package/src/colours.js +116 -96
  232. package/src/components/AddButton.js +32 -27
  233. package/src/components/AddToCalendarButton.js +236 -202
  234. package/src/components/Attachment.js +59 -36
  235. package/src/components/AudienceSelectorLauncher.js +52 -48
  236. package/src/components/AudienceSelectorPage.js +353 -311
  237. package/src/components/AutoOffsetImage.js +237 -196
  238. package/src/components/BackButton.js +57 -41
  239. package/src/components/CalendarPopup.js +127 -97
  240. package/src/components/CategoryTabs.js +208 -163
  241. package/src/components/CommentReply.js +370 -309
  242. package/src/components/CommentSection.js +974 -781
  243. package/src/components/ConfirmPopup.js +141 -110
  244. package/src/components/ConfirmationPopup.js +80 -69
  245. package/src/components/DocumentUploader.js +245 -215
  246. package/src/components/DropDownItem.js +70 -60
  247. package/src/components/DropDownMenu.js +31 -27
  248. package/src/components/EmptyStateMain.js +51 -44
  249. package/src/components/EmptyStateWidget.js +47 -38
  250. package/src/components/FontScaleButton.js +29 -25
  251. package/src/components/FontScalePopup.js +67 -56
  252. package/src/components/Forbidden.js +48 -46
  253. package/src/components/FormCard.js +21 -17
  254. package/src/components/FormCardSection.js +284 -233
  255. package/src/components/FormCardSectionOptionLauncher.js +72 -46
  256. package/src/components/FormattedText.js +128 -111
  257. package/src/components/GenericInput.js +168 -136
  258. package/src/components/GenericInputSection.js +209 -161
  259. package/src/components/Header.js +620 -474
  260. package/src/components/Icon.js +119 -0
  261. package/src/components/ImagePopup.js +425 -221
  262. package/src/components/ImageUploadProgress.js +49 -41
  263. package/src/components/ImageUploader.js +968 -797
  264. package/src/components/InlineButton.js +79 -69
  265. package/src/components/Input.js +190 -156
  266. package/src/components/LoadingCircles.js +233 -233
  267. package/src/components/LoadingIndicator.js +87 -76
  268. package/src/components/LoadingStateWidget.js +47 -37
  269. package/src/components/MediaPlayer.js +416 -387
  270. package/src/components/MiddlePopup.js +62 -33
  271. package/src/components/PDFPopup.js +212 -159
  272. package/src/components/PlussChat.js +1224 -1025
  273. package/src/components/PlussChatMessage.js +329 -298
  274. package/src/components/PlussChatTime.js +57 -53
  275. package/src/components/Popup.js +138 -116
  276. package/src/components/PopupMenu.js +140 -110
  277. package/src/components/PositionedImage.js +281 -237
  278. package/src/components/ProfilePic.js +122 -113
  279. package/src/components/RadioButton.js +76 -52
  280. package/src/components/Reaction.js +134 -96
  281. package/src/components/Reactions.js +65 -63
  282. package/src/components/SharingTools.js +185 -134
  283. package/src/components/Spinner.js +13 -13
  284. package/src/components/StickyFooter.js +36 -26
  285. package/src/components/Text.js +62 -0
  286. package/src/components/TickIcon.js +20 -20
  287. package/src/components/Toggle.js +74 -73
  288. package/src/components/TouchableSearchBar.js +68 -50
  289. package/src/components/UserListPopup.js +161 -124
  290. package/src/components/UserListing.js +273 -238
  291. package/src/components/VideoPopup.js +110 -96
  292. package/src/components/WarningPopup.js +92 -71
  293. package/src/components/expo-image-picker-multiple/ImageBrowser.js +288 -256
  294. package/src/components/expo-image-picker-multiple/ImageTile.js +108 -84
  295. package/src/components/index.js +59 -58
  296. package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +444 -359
  297. package/src/components/react-native-expo-image-cropper/ImageCropOverlay.js +420 -324
  298. package/src/config.js +26 -21
  299. package/src/constants.js +8 -10
  300. package/src/helper.js +469 -438
  301. package/src/index.js +24 -12
  302. package/src/js/images/detectFaces.js +28 -21
  303. package/src/js/images/findLandmarkRange.js +97 -90
  304. package/src/js/images/getScaledOffset.js +80 -75
  305. package/src/js/site/getSiteLevelFromState.js +26 -26
  306. package/src/js/site/isTVEnabled.js +10 -10
  307. package/src/session.js +32 -32
  308. package/src/styles.js +61 -61
  309. package/src/withNavigationFocus.js +28 -0
  310. package/dist/module/components/TextStyle.js +0 -45
  311. package/dist/module/components/TextStyle.js.map +0 -1
  312. package/dist/module/fonts/index.js +0 -2
  313. package/dist/module/fonts/index.js.map +0 -1
  314. package/dist/module/fonts/pluss60-icons.js +0 -5
  315. package/dist/module/fonts/pluss60-icons.js.map +0 -1
  316. package/dist/module/fonts/pluss60-icons.json +0 -1097
  317. package/src/components/TextStyle.js +0 -48
  318. package/src/fonts/index.js +0 -1
  319. package/src/fonts/pluss60-icons.js +0 -7
  320. package/src/fonts/pluss60-icons.json +0 -1097
@@ -1 +1 @@
1
- {"version":3,"names":["stringActions","moment","FileSystem","detectFaces","remoteUrl","parts","split","splice","mediaId","extension","downloadPath","cacheDirectory","uri","localUrl","downloadAsync","faces","image","timestamp","valueOf","setString","encodeURIComponent"],"sources":["detectFaces.js"],"sourcesContent":["import { stringActions } from '../../apis';\nimport moment from 'moment';\nimport * as FileSystem from 'expo-file-system';\n// import * as FaceDetector from 'expo-face-detector';\n\nconst detectFaces = async remoteUrl => {\n // deprecated\n\n const parts = remoteUrl.split('/').splice(-2);\n const mediaId = parts[0];\n const extension = parts[1].split('.').splice(-1)[0];\n\n const downloadPath = `${FileSystem.cacheDirectory}${mediaId}.${extension}`;\n\n const { uri: localUrl } = await FileSystem.downloadAsync(remoteUrl, downloadPath);\n\n // const faces = await FaceDetector.detectFacesAsync(localUrl, {\n // mode: FaceDetector.FaceDetectorMode.accurate,\n // });\n\n const faces = null;\n\n if (faces && faces.image && faces.image.uri) {\n delete faces.image.uri;\n }\n\n faces.timestamp = moment().valueOf();\n\n stringActions.setString('plussSpace', `imagefaces_${encodeURIComponent(remoteUrl)}`, faces);\n\n return faces;\n};\n\nexport default detectFaces;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,YAAY;AAC1C,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C;;AAEA,MAAMC,WAAW,GAAG,MAAMC,SAAS,IAAI;EACrC;;EAEA,MAAMC,KAAK,GAAGD,SAAS,CAACE,KAAK,CAAC,GAAG,CAAC,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;EAC7C,MAAMC,OAAO,GAAGH,KAAK,CAAC,CAAC,CAAC;EACxB,MAAMI,SAAS,GAAGJ,KAAK,CAAC,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EAEnD,MAAMG,YAAY,GAAG,GAAGR,UAAU,CAACS,cAAc,GAAGH,OAAO,IAAIC,SAAS,EAAE;EAE1E,MAAM;IAAEG,GAAG,EAAEC;EAAS,CAAC,GAAG,MAAMX,UAAU,CAACY,aAAa,CAACV,SAAS,EAAEM,YAAY,CAAC;;EAEjF;EACA;EACA;;EAEA,MAAMK,KAAK,GAAG,IAAI;EAElB,IAAIA,KAAK,IAAIA,KAAK,CAACC,KAAK,IAAID,KAAK,CAACC,KAAK,CAACJ,GAAG,EAAE;IAC3C,OAAOG,KAAK,CAACC,KAAK,CAACJ,GAAG;EACxB;EAEAG,KAAK,CAACE,SAAS,GAAGhB,MAAM,CAAC,CAAC,CAACiB,OAAO,CAAC,CAAC;EAEpClB,aAAa,CAACmB,SAAS,CAAC,YAAY,EAAE,cAAcC,kBAAkB,CAAChB,SAAS,CAAC,EAAE,EAAEW,KAAK,CAAC;EAE3F,OAAOA,KAAK;AACd,CAAC;AAED,eAAeZ,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["stringActions","moment","File","Paths","detectFaces","remoteUrl","_parts$","parts","split","splice","mediaId","extension","file","downloadFileAsync","cache","idempotent","localUrl","uri","faces","image","timestamp","valueOf","setString","encodeURIComponent"],"sources":["detectFaces.js"],"sourcesContent":["import { stringActions } from \"../../apis\";\nimport moment from \"moment\";\nimport { File, Paths } from \"expo-file-system\";\n// import * as FaceDetector from 'expo-face-detector';\n\nconst detectFaces = async (remoteUrl) => {\n\t// deprecated\n\n\tconst parts = remoteUrl.split(\"/\").splice(-2);\n\tconst mediaId = parts[0];\n\tconst extension = parts[1]?.split(\".\").splice(-1)[0] || \"jpg\";\n\n\tconst file = await File.downloadFileAsync(\n\t\tremoteUrl,\n\t\tnew File(Paths.cache, `${mediaId}.${extension}`),\n\t\t{ idempotent: true },\n\t);\n\tconst localUrl = file.uri;\n\n\t// const faces = await FaceDetector.detectFacesAsync(localUrl, {\n\t// mode: FaceDetector.FaceDetectorMode.accurate,\n\t// });\n\n\tconst faces = null;\n\n\tif (faces && faces.image && faces.image.uri) {\n\t\tdelete faces.image.uri;\n\t}\n\n\tfaces.timestamp = moment().valueOf();\n\n\tstringActions.setString(\n\t\t\"plussSpace\",\n\t\t`imagefaces_${encodeURIComponent(remoteUrl)}`,\n\t\tfaces,\n\t);\n\n\treturn faces;\n};\n\nexport default detectFaces;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,YAAY;AAC1C,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;AAC9C;;AAEA,MAAMC,WAAW,GAAG,MAAOC,SAAS,IAAK;EAAA,IAAAC,OAAA;EACxC;;EAEA,MAAMC,KAAK,GAAGF,SAAS,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;EAC7C,MAAMC,OAAO,GAAGH,KAAK,CAAC,CAAC,CAAC;EACxB,MAAMI,SAAS,GAAG,EAAAL,OAAA,GAAAC,KAAK,CAAC,CAAC,CAAC,cAAAD,OAAA,uBAARA,OAAA,CAAUE,KAAK,CAAC,GAAG,CAAC,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAI,KAAK;EAE7D,MAAMG,IAAI,GAAG,MAAMV,IAAI,CAACW,iBAAiB,CACxCR,SAAS,EACT,IAAIH,IAAI,CAACC,KAAK,CAACW,KAAK,EAAE,GAAGJ,OAAO,IAAIC,SAAS,EAAE,CAAC,EAChD;IAAEI,UAAU,EAAE;EAAK,CACpB,CAAC;EACD,MAAMC,QAAQ,GAAGJ,IAAI,CAACK,GAAG;;EAEzB;EACA;EACA;;EAEA,MAAMC,KAAK,GAAG,IAAI;EAElB,IAAIA,KAAK,IAAIA,KAAK,CAACC,KAAK,IAAID,KAAK,CAACC,KAAK,CAACF,GAAG,EAAE;IAC5C,OAAOC,KAAK,CAACC,KAAK,CAACF,GAAG;EACvB;EAEAC,KAAK,CAACE,SAAS,GAAGnB,MAAM,CAAC,CAAC,CAACoB,OAAO,CAAC,CAAC;EAEpCrB,aAAa,CAACsB,SAAS,CACtB,YAAY,EACZ,cAAcC,kBAAkB,CAAClB,SAAS,CAAC,EAAE,EAC7Ca,KACD,CAAC;EAED,OAAOA,KAAK;AACb,CAAC;AAED,eAAed,WAAW","ignoreList":[]}
@@ -1,20 +1,20 @@
1
- import _ from 'lodash';
2
- import moment from 'moment';
3
- import { stringActions } from '../../apis';
4
- import detectFaces from './detectFaces';
5
- import getScaledOffset from './getScaledOffset';
1
+ import _ from "lodash";
2
+ import moment from "moment";
3
+ import { stringActions } from "../../apis";
4
+ import detectFaces from "./detectFaces";
5
+ import getScaledOffset from "./getScaledOffset";
6
6
  const findLandmarkRange = async (url, options) => {
7
7
  let cachedValues;
8
8
  if (options && options.cachedValues) {
9
9
  cachedValues = options.cachedValues;
10
10
  }
11
11
  try {
12
- const response = await stringActions.getString('plussSpace', `imagefaces_${encodeURIComponent(url)}`);
12
+ const response = await stringActions.getString("plussSpace", `imagefaces_${encodeURIComponent(url)}`);
13
13
  cachedValues = response.data;
14
14
  } catch (e) {
15
- console.log('errored from cache');
15
+ console.log("errored from cache");
16
16
  }
17
- if (!cachedValues || !cachedValues.faces || !cachedValues.image || _.isEmpty(cachedValues.faces) && moment().add(-1, 'w').valueOf() > moment(cachedValues.timestamp).valueOf()) {
17
+ if (!cachedValues || !cachedValues.faces || !cachedValues.image || _.isEmpty(cachedValues.faces) && moment().add(-1, "w").valueOf() > moment(cachedValues.timestamp).valueOf()) {
18
18
  cachedValues = await detectFaces(url);
19
19
  }
20
20
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["_","moment","stringActions","detectFaces","getScaledOffset","findLandmarkRange","url","options","cachedValues","response","getString","encodeURIComponent","data","e","console","log","faces","image","isEmpty","add","valueOf","timestamp","landmarkStartX","landmarkStartY","landmarkEndX","landmarkEndY","width","height","forEach","face","bounds","origin","x","y","faceEndX","size","faceEndY","targetWidth","targetHeight","scaleFactor","start","end"],"sources":["findLandmarkRange.js"],"sourcesContent":["import _ from 'lodash';\nimport moment from 'moment';\nimport { stringActions } from '../../apis';\nimport detectFaces from './detectFaces';\nimport getScaledOffset from './getScaledOffset';\n\nconst findLandmarkRange = async (url, options) => {\n let cachedValues;\n if (options && options.cachedValues) {\n cachedValues = options.cachedValues;\n }\n try {\n const response = await stringActions.getString('plussSpace', `imagefaces_${encodeURIComponent(url)}`);\n cachedValues = response.data;\n } catch (e) {\n console.log('errored from cache');\n }\n if (\n !cachedValues ||\n !cachedValues.faces ||\n !cachedValues.image ||\n (_.isEmpty(cachedValues.faces) &&\n moment()\n .add(-1, 'w')\n .valueOf() > moment(cachedValues.timestamp).valueOf())\n ) {\n cachedValues = await detectFaces(url);\n }\n const { faces, image } = cachedValues;\n\n let landmarkStartX = null;\n let landmarkStartY = null;\n let landmarkEndX = null;\n let landmarkEndY = null;\n\n if (_.isEmpty(faces)) {\n landmarkStartX = image.width / 2;\n landmarkStartY = image.height / 2;\n landmarkEndX = image.width / 2;\n landmarkEndY = image.height / 2;\n } else {\n faces.forEach(face => {\n const { bounds } = face;\n\n if (!landmarkStartX || bounds.origin.x < landmarkStartX) {\n landmarkStartX = bounds.origin.x;\n }\n\n if (!landmarkStartY || bounds.origin.y < landmarkStartY) {\n landmarkStartY = bounds.origin.y;\n }\n\n const faceEndX = bounds.origin.x + bounds.size.width;\n if (!landmarkEndX || faceEndX > landmarkEndX) {\n landmarkEndX = faceEndX;\n }\n\n const faceEndY = bounds.origin.y + bounds.size.height;\n if (!landmarkEndY || faceEndX > landmarkEndY) {\n landmarkEndY = faceEndY;\n }\n });\n }\n\n let targetWidth = image.width;\n let targetHeight = image.height;\n\n if (options && options.targetWidth && options.targetHeight) {\n const { scaleFactor } = getScaledOffset(image.width, image.height, options.targetWidth, options.targetHeight);\n landmarkStartX *= scaleFactor;\n landmarkStartY *= scaleFactor;\n landmarkEndX *= scaleFactor;\n landmarkEndY *= scaleFactor;\n targetWidth = options.targetWidth;\n targetHeight = options.targetHeight;\n }\n\n if (landmarkStartX < 0) {\n landmarkStartX = 0;\n }\n if (landmarkStartY < 0) {\n landmarkStartY = 0;\n }\n if (landmarkEndX > targetWidth) {\n landmarkEndX = targetWidth;\n }\n if (landmarkEndY > targetHeight) {\n landmarkEndY = targetHeight;\n }\n\n return {\n start: {\n x: landmarkStartX,\n y: landmarkStartY,\n },\n end: {\n x: landmarkEndX,\n y: landmarkEndY,\n },\n height: image.height,\n width: image.width,\n };\n};\n\nexport default findLandmarkRange;\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AACtB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,aAAa,QAAQ,YAAY;AAC1C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,MAAMC,iBAAiB,GAAG,MAAAA,CAAOC,GAAG,EAAEC,OAAO,KAAK;EAChD,IAAIC,YAAY;EAChB,IAAID,OAAO,IAAIA,OAAO,CAACC,YAAY,EAAE;IACnCA,YAAY,GAAGD,OAAO,CAACC,YAAY;EACrC;EACA,IAAI;IACF,MAAMC,QAAQ,GAAG,MAAMP,aAAa,CAACQ,SAAS,CAAC,YAAY,EAAE,cAAcC,kBAAkB,CAACL,GAAG,CAAC,EAAE,CAAC;IACrGE,YAAY,GAAGC,QAAQ,CAACG,IAAI;EAC9B,CAAC,CAAC,OAAOC,CAAC,EAAE;IACV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AY;EAC7B;EAEA,OAAO;IACLE,KAAK,EAAE;MACLR,CAAC,EAAEV,cAAc;MACjBW,CAAC,EAAEV;IACL,CAAC;IACDkB,GAAG,EAAE;MACHT,CAAC,EAAER,YAAY;MACfS,CAAC,EAAER;IACL,CAAC;IACDE,MAAM,EAAEV,KAAK,CAACU,MAAM;IACpBD,KAAK,EAAET,KAAK,CAACS;EACf,CAAC;AACH,CAAC;AAED,eAAerB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["_","moment","stringActions","detectFaces","getScaledOffset","findLandmarkRange","url","options","cachedValues","response","getString","encodeURIComponent","data","e","console","log","faces","image","isEmpty","add","valueOf","timestamp","landmarkStartX","landmarkStartY","landmarkEndX","landmarkEndY","width","height","forEach","face","bounds","origin","x","y","faceEndX","size","faceEndY","targetWidth","targetHeight","scaleFactor","start","end"],"sources":["findLandmarkRange.js"],"sourcesContent":["import _ from \"lodash\";\nimport moment from \"moment\";\nimport { stringActions } from \"../../apis\";\nimport detectFaces from \"./detectFaces\";\nimport getScaledOffset from \"./getScaledOffset\";\n\nconst findLandmarkRange = async (url, options) => {\n\tlet cachedValues;\n\tif (options && options.cachedValues) {\n\t\tcachedValues = options.cachedValues;\n\t}\n\ttry {\n\t\tconst response = await stringActions.getString(\n\t\t\t\"plussSpace\",\n\t\t\t`imagefaces_${encodeURIComponent(url)}`,\n\t\t);\n\t\tcachedValues = response.data;\n\t} catch (e) {\n\t\tconsole.log(\"errored from cache\");\n\t}\n\tif (\n\t\t!cachedValues ||\n\t\t!cachedValues.faces ||\n\t\t!cachedValues.image ||\n\t\t(_.isEmpty(cachedValues.faces) &&\n\t\t\tmoment().add(-1, \"w\").valueOf() >\n\t\t\t\tmoment(cachedValues.timestamp).valueOf())\n\t) {\n\t\tcachedValues = await detectFaces(url);\n\t}\n\tconst { faces, image } = cachedValues;\n\n\tlet landmarkStartX = null;\n\tlet landmarkStartY = null;\n\tlet landmarkEndX = null;\n\tlet landmarkEndY = null;\n\n\tif (_.isEmpty(faces)) {\n\t\tlandmarkStartX = image.width / 2;\n\t\tlandmarkStartY = image.height / 2;\n\t\tlandmarkEndX = image.width / 2;\n\t\tlandmarkEndY = image.height / 2;\n\t} else {\n\t\tfaces.forEach((face) => {\n\t\t\tconst { bounds } = face;\n\n\t\t\tif (!landmarkStartX || bounds.origin.x < landmarkStartX) {\n\t\t\t\tlandmarkStartX = bounds.origin.x;\n\t\t\t}\n\n\t\t\tif (!landmarkStartY || bounds.origin.y < landmarkStartY) {\n\t\t\t\tlandmarkStartY = bounds.origin.y;\n\t\t\t}\n\n\t\t\tconst faceEndX = bounds.origin.x + bounds.size.width;\n\t\t\tif (!landmarkEndX || faceEndX > landmarkEndX) {\n\t\t\t\tlandmarkEndX = faceEndX;\n\t\t\t}\n\n\t\t\tconst faceEndY = bounds.origin.y + bounds.size.height;\n\t\t\tif (!landmarkEndY || faceEndX > landmarkEndY) {\n\t\t\t\tlandmarkEndY = faceEndY;\n\t\t\t}\n\t\t});\n\t}\n\n\tlet targetWidth = image.width;\n\tlet targetHeight = image.height;\n\n\tif (options && options.targetWidth && options.targetHeight) {\n\t\tconst { scaleFactor } = getScaledOffset(\n\t\t\timage.width,\n\t\t\timage.height,\n\t\t\toptions.targetWidth,\n\t\t\toptions.targetHeight,\n\t\t);\n\t\tlandmarkStartX *= scaleFactor;\n\t\tlandmarkStartY *= scaleFactor;\n\t\tlandmarkEndX *= scaleFactor;\n\t\tlandmarkEndY *= scaleFactor;\n\t\ttargetWidth = options.targetWidth;\n\t\ttargetHeight = options.targetHeight;\n\t}\n\n\tif (landmarkStartX < 0) {\n\t\tlandmarkStartX = 0;\n\t}\n\tif (landmarkStartY < 0) {\n\t\tlandmarkStartY = 0;\n\t}\n\tif (landmarkEndX > targetWidth) {\n\t\tlandmarkEndX = targetWidth;\n\t}\n\tif (landmarkEndY > targetHeight) {\n\t\tlandmarkEndY = targetHeight;\n\t}\n\n\treturn {\n\t\tstart: {\n\t\t\tx: landmarkStartX,\n\t\t\ty: landmarkStartY,\n\t\t},\n\t\tend: {\n\t\t\tx: landmarkEndX,\n\t\t\ty: landmarkEndY,\n\t\t},\n\t\theight: image.height,\n\t\twidth: image.width,\n\t};\n};\n\nexport default findLandmarkRange;\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AACtB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,aAAa,QAAQ,YAAY;AAC1C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,MAAMC,iBAAiB,GAAG,MAAAA,CAAOC,GAAG,EAAEC,OAAO,KAAK;EACjD,IAAIC,YAAY;EAChB,IAAID,OAAO,IAAIA,OAAO,CAACC,YAAY,EAAE;IACpCA,YAAY,GAAGD,OAAO,CAACC,YAAY;EACpC;EACA,IAAI;IACH,MAAMC,QAAQ,GAAG,MAAMP,aAAa,CAACQ,SAAS,CAC7C,YAAY,EACZ,cAAcC,kBAAkB,CAACL,GAAG,CAAC,EACtC,CAAC;IACDE,YAAY,GAAGC,QAAQ,CAACG,IAAI;EAC7B,CAAC,CAAC,OAAOC,CAAC,EAAE;IACXC,OAAO,CAACC,GAAG,CAAC,oBAAoB,CAAC;EAClC;EACA,IACC,CAACP,YAAY,IACb,CAACA,YAAY,CAACQ,KAAK,IACnB,CAACR,YAAY,CAACS,KAAK,IAClBjB,CAAC,CAACkB,OAAO,CAACV,YAAY,CAACQ,KAAK,CAAC,IAC7Bf,MAAM,CAAC,CAAC,CAACkB,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAACC,OAAO,CAAC,CAAC,GAC9BnB,MAAM,CAACO,YAAY,CAACa,SAAS,CAAC,CAACD,OAAO,CAAC,CAAE,EAC1C;IACDZ,YAAY,GAAG,MAAML,WAAW,CAACG,GAAG,CAAC;EACtC;EACA,MAAM;IAAEU,KAAK;IAAEC;EAAM,CAAC,GAAGT,YAAY;EAErC,IAAIc,cAAc,GAAG,IAAI;EACzB,IAAIC,cA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AO,IAAIA,OAAO,CAAC8B,WAAW,IAAI9B,OAAO,CAAC+B,YAAY,EAAE;IAC3D,MAAM;MAAEC;IAAY,CAAC,GAAGnC,eAAe,CACtCa,KAAK,CAACS,KAAK,EACXT,KAAK,CAACU,MAAM,EACZpB,OAAO,CAAC8B,WAAW,EACnB9B,OAAO,CAAC+B,YACT,CAAC;IACDhB,cAAc,IAAIiB,WAAW;IAC7BhB,cAAc,IAAIgB,WAAW;IAC7Bf,YAAY,IAAIe,WAAW;IAC3Bd,YAAY,IAAIc,WAAW;IAC3BF,WAAW,GAAG9B,OAAO,CAAC8B,WAAW;IACjCC,YAAY,GAAG/B,OAAO,CAAC+B,YAAY;EACpC;EAEA,IAAIhB,cAAc,GAAG,CAAC,EAAE;IACvBA,cAAc,GAAG,CAAC;EACnB;EACA,IAAIC,cAAc,GAAG,CAAC,EAAE;IACvBA,cAAc,GAAG,CAAC;EACnB;EACA,IAAIC,YAAY,GAAGa,WAAW,EAAE;IAC/Bb,YAAY,GAAGa,WAAW;EAC3B;EACA,IAAIZ,YAAY,GAAGa,YAAY,EAAE;IAChCb,YAAY,GAAGa,YAAY;EAC5B;EAEA,OAAO;IACNE,KAAK,EAAE;MACNR,CAAC,EAAEV,cAAc;MACjBW,CAAC,EAAEV;IACJ,CAAC;IACDkB,GAAG,EAAE;MACJT,CAAC,EAAER,YAAY;MACfS,CAAC,EAAER;IACJ,CAAC;IACDE,MAAM,EAAEV,KAAK,CAACU,MAAM;IACpBD,KAAK,EAAET,KAAK,CAACS;EACd,CAAC;AACF,CAAC;AAED,eAAerB,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getScaledOffset","sourceWidth","sourceHeight","targetWidth","targetHeight","sourceRatio","targetRatio","width","height","scaleFactor","offset","x","y","bounds","start","end","adjustedHeight","yOffset","adjustedWidth","xOffset"],"sources":["getScaledOffset.js"],"sourcesContent":["const getScaledOffset = (sourceWidth, sourceHeight, targetWidth, targetHeight) => {\n const sourceRatio = sourceWidth / sourceHeight;\n const targetRatio = targetWidth / targetHeight;\n\n // same ratio. no adjustment needed.\n if (sourceRatio === targetRatio) {\n return {\n width: targetWidth,\n height: targetHeight,\n scaleFactor: targetWidth / sourceWidth,\n offset: {\n x: 0,\n y: 0,\n },\n bounds: {\n start: {\n x: 0,\n y: 0,\n },\n end: {\n x: targetWidth,\n y: targetHeight,\n },\n },\n };\n }\n\n // source is higher than target. height scaling and y offset required.\n if (sourceRatio < targetRatio) {\n const scaleFactor = targetWidth / sourceWidth;\n const adjustedHeight = sourceHeight * scaleFactor;\n const yOffset = (adjustedHeight - targetHeight) / 2;\n\n return {\n width: targetWidth,\n height: adjustedHeight,\n scaleFactor,\n offset: {\n x: 0,\n y: -yOffset,\n },\n bounds: {\n start: {\n x: 0,\n y: yOffset,\n },\n end: {\n x: targetWidth,\n y: yOffset + adjustedHeight,\n },\n },\n };\n }\n\n // source is wider than target. width scaling and x offset required.\n if (sourceRatio > targetRatio) {\n const scaleFactor = targetHeight / sourceHeight;\n const adjustedWidth = sourceWidth * scaleFactor;\n const xOffset = (adjustedWidth - targetWidth) / 2;\n\n return {\n width: adjustedWidth,\n height: targetHeight,\n scaleFactor,\n offset: {\n x: -xOffset,\n y: 0,\n },\n bounds: {\n start: {\n x: xOffset,\n y: 0,\n },\n end: {\n x: xOffset + adjustedWidth,\n y: targetHeight,\n },\n },\n };\n }\n};\n\nexport default getScaledOffset;\n"],"mappings":"AAAA,MAAMA,eAAe,GAAGA,CAACC,WAAW,EAAEC,YAAY,EAAEC,WAAW,EAAEC,YAAY,KAAK;EAChF,MAAMC,WAAW,GAAGJ,WAAW,GAAGC,YAAY;EAC9C,MAAMI,WAAW,GAAGH,WAAW,GAAGC,YAAY;;EAE9C;EACA,IAAIC,WAAW,KAAKC,WAAW,EAAE;IAC/B,OAAO;MACLC,KAAK,EAAEJ,WAAW;MAClBK,MAAM,EAAEJ,YAAY;MACpBK,WAAW,EAAEN,WAAW,GAAGF,WAAW;MACtCS,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EAAE;QACL,CAAC;QACDG,GAAG,EAAE;UACHJ,CAAC,EAAEQ,OAAO,GAAGD,aAAa;UAC1BN,CAAC,EAAER;QACL;MACF;IACF,CAAC;EACH;AACF,CAAC;AAED,eAAeJ,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["getScaledOffset","sourceWidth","sourceHeight","targetWidth","targetHeight","sourceRatio","targetRatio","width","height","scaleFactor","offset","x","y","bounds","start","end","adjustedHeight","yOffset","adjustedWidth","xOffset"],"sources":["getScaledOffset.js"],"sourcesContent":["const getScaledOffset = (\n\tsourceWidth,\n\tsourceHeight,\n\ttargetWidth,\n\ttargetHeight,\n) => {\n\tconst sourceRatio = sourceWidth / sourceHeight;\n\tconst targetRatio = targetWidth / targetHeight;\n\n\t// same ratio. no adjustment needed.\n\tif (sourceRatio === targetRatio) {\n\t\treturn {\n\t\t\twidth: targetWidth,\n\t\t\theight: targetHeight,\n\t\t\tscaleFactor: targetWidth / sourceWidth,\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t},\n\t\t\tbounds: {\n\t\t\t\tstart: {\n\t\t\t\t\tx: 0,\n\t\t\t\t\ty: 0,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\tx: targetWidth,\n\t\t\t\t\ty: targetHeight,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\t// source is higher than target. height scaling and y offset required.\n\tif (sourceRatio < targetRatio) {\n\t\tconst scaleFactor = targetWidth / sourceWidth;\n\t\tconst adjustedHeight = sourceHeight * scaleFactor;\n\t\tconst yOffset = (adjustedHeight - targetHeight) / 2;\n\n\t\treturn {\n\t\t\twidth: targetWidth,\n\t\t\theight: adjustedHeight,\n\t\t\tscaleFactor,\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: -yOffset,\n\t\t\t},\n\t\t\tbounds: {\n\t\t\t\tstart: {\n\t\t\t\t\tx: 0,\n\t\t\t\t\ty: yOffset,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\tx: targetWidth,\n\t\t\t\t\ty: yOffset + adjustedHeight,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\t// source is wider than target. width scaling and x offset required.\n\tif (sourceRatio > targetRatio) {\n\t\tconst scaleFactor = targetHeight / sourceHeight;\n\t\tconst adjustedWidth = sourceWidth * scaleFactor;\n\t\tconst xOffset = (adjustedWidth - targetWidth) / 2;\n\n\t\treturn {\n\t\t\twidth: adjustedWidth,\n\t\t\theight: targetHeight,\n\t\t\tscaleFactor,\n\t\t\toffset: {\n\t\t\t\tx: -xOffset,\n\t\t\t\ty: 0,\n\t\t\t},\n\t\t\tbounds: {\n\t\t\t\tstart: {\n\t\t\t\t\tx: xOffset,\n\t\t\t\t\ty: 0,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\tx: xOffset + adjustedWidth,\n\t\t\t\t\ty: targetHeight,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n};\n\nexport default getScaledOffset;\n"],"mappings":"AAAA,MAAMA,eAAe,GAAGA,CACvBC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,YAAY,KACR;EACJ,MAAMC,WAAW,GAAGJ,WAAW,GAAGC,YAAY;EAC9C,MAAMI,WAAW,GAAGH,WAAW,GAAGC,YAAY;;EAE9C;EACA,IAAIC,WAAW,KAAKC,WAAW,EAAE;IAChC,OAAO;MACNC,KAAK,EAAEJ,WAAW;MAClBK,MAAM,EAAEJ,YAAY;MACpBK,WAAW,EAAEN,WAAW,GAAGF,WAAW;MACtCS,MAAM,EAAE;QACPC,CAAC,EAAE,CAAC;QACJC,CAAC,EAAE;MACJ,CAAC;MACDC,MAAM,EAAE;QACPC,KAAK,EAAE;UACNH,CAAC,EAAE,CAAC;UACJC,CAAC,EAAE;QACJ,CAAC;QACDG,GAAG,EAAE;UACJJ,CAAC,EAAER,WAAW;UACdS,CAAC,EAAER;QACJ;MACD;IACD,CAAC;EACF;;EAEA;E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3
3
  if (state && state.user && state.user.siteInfo && state.user.siteInfo.Type) {
4
4
  siteType = state.user.siteInfo.Type;
5
5
  }
@@ -13,7 +13,7 @@ const getSiteLevelFromState = state => {
13
13
  hasPersonalDocuments: true
14
14
  };
15
15
  switch (siteType) {
16
- case 'free':
16
+ case "free":
17
17
  siteConfig.hasTV = false;
18
18
  siteConfig.hasPayments = false;
19
19
  siteConfig.hasPersonalNotes = false;
@@ -1 +1 @@
1
- {"version":3,"names":["getSiteLevelFromState","state","siteType","user","siteInfo","Type","siteConfig","type","hasTV","hasKiosk","hasPayments","hasPersonalNotes","hasEmergencyContacts","hasPersonalDocuments"],"sources":["getSiteLevelFromState.js"],"sourcesContent":["const getSiteLevelFromState = state => {\n let siteType = 'legacy';\n if (state && state.user && state.user.siteInfo && state.user.siteInfo.Type) {\n siteType = state.user.siteInfo.Type;\n }\n const siteConfig = {\n type: siteType,\n hasTV: true,\n hasKiosk: false,\n hasPayments: true,\n hasPersonalNotes: true,\n hasEmergencyContacts: true,\n hasPersonalDocuments: true,\n };\n\n switch (siteType) {\n case 'free':\n siteConfig.hasTV = false;\n siteConfig.hasPayments = false;\n siteConfig.hasPersonalNotes = false;\n siteConfig.hasEmergencyContacts = false;\n siteConfig.hasPersonalDocuments = false;\n break;\n default:\n break;\n }\n return siteConfig;\n};\n\nexport default getSiteLevelFromState;\n"],"mappings":"AAAA,MAAMA,qBAAqB,GAAGC,KAAK,IAAI;EACrC,IAAIC,QAAQ,GAAG,QAAQ;EACvB,IAAID,KAAK,IAAIA,KAAK,CAACE,IAAI,IAAIF,KAAK,CAACE,IAAI,CAACC,QAAQ,IAAIH,KAAK,CAACE,IAAI,CAACC,QAAQ,CAACC,IAAI,EAAE;IAC1EH,QAAQ,GAAGD,KAAK,CAACE,IAAI,CAACC,QAAQ,CAACC,IAAI;EACrC;EACA,MAAMC,UAAU,GAAG;IACjBC,IAAI,EAAEL,QAAQ;IACdM,KAAK,EAAE,IAAI;IACXC,QAAQ,EAAE,KAAK;IACfC,WAAW,EAAE,IAAI;IACjBC,gBAAgB,EAAE,IAAI;IACtBC,oBAAoB,EAAE,IAAI;IAC1BC,oBAAoB,EAAE;EACxB,CAAC;EAED,QAAQX,QAAQ;IACd,KAAK,MAAM;MACTI,UAAU,CAACE,KAAK,GAAG,KAAK;MACxBF,UAAU,CAACI,WAAW,GAAG,KAAK;MAC9BJ,UAAU,CAACK,gBAAgB,GAAG,KAAK;MACnCL,UAAU,CAACM,oBAAoB,GAAG,KAAK;MACvCN,UAAU,CAACO,oBAAoB,GAAG,KAAK;MACvC;IACF;MACE;EACJ;EACA,OAAOP,UAAU;AACnB,CAAC;AAED,eAAeN,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["getSiteLevelFromState","state","siteType","user","siteInfo","Type","siteConfig","type","hasTV","hasKiosk","hasPayments","hasPersonalNotes","hasEmergencyContacts","hasPersonalDocuments"],"sources":["getSiteLevelFromState.js"],"sourcesContent":["const getSiteLevelFromState = (state) => {\n\tlet siteType = \"legacy\";\n\tif (state && state.user && state.user.siteInfo && state.user.siteInfo.Type) {\n\t\tsiteType = state.user.siteInfo.Type;\n\t}\n\tconst siteConfig = {\n\t\ttype: siteType,\n\t\thasTV: true,\n\t\thasKiosk: false,\n\t\thasPayments: true,\n\t\thasPersonalNotes: true,\n\t\thasEmergencyContacts: true,\n\t\thasPersonalDocuments: true,\n\t};\n\n\tswitch (siteType) {\n\t\tcase \"free\":\n\t\t\tsiteConfig.hasTV = false;\n\t\t\tsiteConfig.hasPayments = false;\n\t\t\tsiteConfig.hasPersonalNotes = false;\n\t\t\tsiteConfig.hasEmergencyContacts = false;\n\t\t\tsiteConfig.hasPersonalDocuments = false;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\treturn siteConfig;\n};\n\nexport default getSiteLevelFromState;\n"],"mappings":"AAAA,MAAMA,qBAAqB,GAAIC,KAAK,IAAK;EACxC,IAAIC,QAAQ,GAAG,QAAQ;EACvB,IAAID,KAAK,IAAIA,KAAK,CAACE,IAAI,IAAIF,KAAK,CAACE,IAAI,CAACC,QAAQ,IAAIH,KAAK,CAACE,IAAI,CAACC,QAAQ,CAACC,IAAI,EAAE;IAC3EH,QAAQ,GAAGD,KAAK,CAACE,IAAI,CAACC,QAAQ,CAACC,IAAI;EACpC;EACA,MAAMC,UAAU,GAAG;IAClBC,IAAI,EAAEL,QAAQ;IACdM,KAAK,EAAE,IAAI;IACXC,QAAQ,EAAE,KAAK;IACfC,WAAW,EAAE,IAAI;IACjBC,gBAAgB,EAAE,IAAI;IACtBC,oBAAoB,EAAE,IAAI;IAC1BC,oBAAoB,EAAE;EACvB,CAAC;EAED,QAAQX,QAAQ;IACf,KAAK,MAAM;MACVI,UAAU,CAACE,KAAK,GAAG,KAAK;MACxBF,UAAU,CAACI,WAAW,GAAG,KAAK;MAC9BJ,UAAU,CAACK,gBAAgB,GAAG,KAAK;MACnCL,UAAU,CAACM,oBAAoB,GAAG,KAAK;MACvCN,UAAU,CAACO,oBAAoB,GAAG,KAAK;MACvC;IACD;MACC;EACF;EACA,OAAOP,UAAU;AAClB,CAAC;AAED,eAAeN,qBAAqB","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import _ from 'lodash';
1
+ import _ from "lodash";
2
2
  const isTVEnabled = (interfaces, feature) => {
3
3
  return _.some(interfaces, t => {
4
- return t.Type === 'TV' && (!feature || _.some(t.Settings.widgets, f => {
4
+ return t.Type === "TV" && (!feature || _.some(t.Settings.widgets, f => {
5
5
  return f.key === feature;
6
6
  }));
7
7
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_","isTVEnabled","interfaces","feature","some","t","Type","Settings","widgets","f","key"],"sources":["isTVEnabled.js"],"sourcesContent":["import _ from 'lodash';\n\nconst isTVEnabled = (interfaces, feature) => {\n return _.some(interfaces, t => {\n return (\n t.Type === 'TV' &&\n (!feature ||\n _.some(t.Settings.widgets, f => {\n return f.key === feature;\n }))\n );\n });\n};\n\nexport default isTVEnabled;\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AAEtB,MAAMC,WAAW,GAAGA,CAACC,UAAU,EAAEC,OAAO,KAAK;EAC3C,OAAOH,CAAC,CAACI,IAAI,CAACF,UAAU,EAAEG,CAAC,IAAI;IAC7B,OACEA,CAAC,CAACC,IAAI,KAAK,IAAI,KACd,CAACH,OAAO,IACPH,CAAC,CAACI,IAAI,CAACC,CAAC,CAACE,QAAQ,CAACC,OAAO,EAAEC,CAAC,IAAI;MAC9B,OAAOA,CAAC,CAACC,GAAG,KAAKP,OAAO;IAC1B,CAAC,CAAC,CAAC;EAET,CAAC,CAAC;AACJ,CAAC;AAED,eAAeF,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["_","isTVEnabled","interfaces","feature","some","t","Type","Settings","widgets","f","key"],"sources":["isTVEnabled.js"],"sourcesContent":["import _ from \"lodash\";\n\nconst isTVEnabled = (interfaces, feature) => {\n\treturn _.some(interfaces, (t) => {\n\t\treturn (\n\t\t\tt.Type === \"TV\" &&\n\t\t\t(!feature ||\n\t\t\t\t_.some(t.Settings.widgets, (f) => {\n\t\t\t\t\treturn f.key === feature;\n\t\t\t\t}))\n\t\t);\n\t});\n};\n\nexport default isTVEnabled;\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AAEtB,MAAMC,WAAW,GAAGA,CAACC,UAAU,EAAEC,OAAO,KAAK;EAC5C,OAAOH,CAAC,CAACI,IAAI,CAACF,UAAU,EAAGG,CAAC,IAAK;IAChC,OACCA,CAAC,CAACC,IAAI,KAAK,IAAI,KACd,CAACH,OAAO,IACRH,CAAC,CAACI,IAAI,CAACC,CAAC,CAACE,QAAQ,CAACC,OAAO,EAAGC,CAAC,IAAK;MACjC,OAAOA,CAAC,CAACC,GAAG,KAAKP,OAAO;IACzB,CAAC,CAAC,CAAC;EAEN,CAAC,CAAC;AACH,CAAC;AAED,eAAeF,WAAW","ignoreList":[]}
@@ -1,9 +1,9 @@
1
- import _ from 'lodash';
2
- import axios from 'axios';
3
- import { Auth } from 'aws-amplify';
1
+ import _ from "lodash";
2
+ import axios from "axios";
3
+ import { Auth } from "aws-amplify";
4
+ import Config from "./config";
4
5
  export const getSessionTokenAWS = async prefix => {
5
- const data = await Auth.currentSession();
6
- const token = data.accessToken.jwtToken;
6
+ const token = await Config.env.AuthStrategy.getAccessToken();
7
7
  if (_.isUndefined(prefix)) return token;
8
8
  return `${prefix} ${token}`;
9
9
  };
@@ -18,7 +18,7 @@ export const getSessionUidAWS = () => {
18
18
  Auth.currentSession().then(data => {
19
19
  resolve(data.accessToken.payload.username);
20
20
  }).catch(err => {
21
- console.log('getSessionUidAWS error', err);
21
+ console.log("getSessionUidAWS error", err);
22
22
  reject(err);
23
23
  });
24
24
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_","axios","Auth","getSessionTokenAWS","prefix","data","currentSession","token","accessToken","jwtToken","isUndefined","getSessionUidAWS","Promise","resolve","reject","then","payload","username","catch","err","console","log","authedFunction","request","authkey","headers","getApiError","error","__DEV__","errorData","response","e"],"sources":["session.js"],"sourcesContent":["import _ from 'lodash';\nimport axios from 'axios';\nimport { Auth } from 'aws-amplify';\n\nexport const getSessionTokenAWS = async prefix => {\n const data = await Auth.currentSession();\n const token = data.accessToken.jwtToken;\n if (_.isUndefined(prefix)) return token;\n return `${prefix} ${token}`;\n};\n\n// export const getRefreshTokenAWS = async () => {\n// const data = await Auth.currentSession();\n// return data.getRefreshToken().token;\n// };\n\nexport const getSessionUidAWS = () => {\n return new Promise((resolve, reject) => {\n Auth.currentSession()\n .then(data => {\n resolve(data.accessToken.payload.username);\n })\n .catch(err => {\n console.log('getSessionUidAWS error', err);\n reject(err);\n });\n });\n};\n\nexport const authedFunction = async request => {\n const authkey = await getSessionTokenAWS();\n if (!request.headers) request.headers = {};\n request.headers.authkey = authkey;\n\n return axios(request);\n};\n\n// export const LogoutAWS = () => {\n// return new Promise((resolve, reject) => {\n// Auth.signOut()\n// .then(() => {\n// resolve();\n// })\n// .catch(err => {\n// reject(err);\n// });\n// });\n// };\n\n// export const isTheBest = auth => {\n// return auth && auth.site === 'plussSpace' && auth.type === 'master';\n// };\n\nexport const getApiError = error => {\n if (!__DEV__) return error;\n try {\n const errorData = error.response.data;\n return errorData || error;\n } catch (e) {\n return error;\n }\n};\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AACtB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,aAAa;AAElC,OAAO,MAAMC,kBAAkB,GAAG,MAAMC,MAAM,IAAI;EAChD,MAAMC,IAAI,GAAG,MAAMH,IAAI,CAACI,cAAc,CAAC,CAAC;EACxC,MAAMC,KAAK,GAAGF,IAAI,CAACG,WAAW,CAACC,QAAQ;EACvC,IAAIT,CAAC,CAACU,WAAW,CAACN,MAAM,CAAC,EAAE,OAAOG,KAAK;EACvC,OAAO,GAAGH,MAAM,IAAIG,KAAK,EAAE;AAC7B,CAAC;;AAED;AACA;AACA;AACA;;AAEA,OAAO,MAAMI,gBAAgB,GAAGA,CAAA,KAAM;EACpC,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtCZ,IAAI,CAACI,cAAc,CAAC,CAAC,CAClBS,IAAI,CAACV,IAAI,IAAI;MACZQ,OAAO,CAACR,IAAI,CAACG,WAAW,CAACQ,OAAO,CAACC,QAAQ,CAAC;IAC5C,CAAC,CAAC,CACDC,KAAK,CAACC,GAAG,IAAI;MACZC,OAAO,CAACC,GAAG,CAAC,wBAAwB,EAAEF,GAAG,CAAC;MAC1CL,MAAM,CAACK,GAAG,CAAC;IACb,CAAC,CAAC;EACN,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMG,cAAc,GAAG,MAAMC,OAAO,IAAI;EAC7C,MAAMC,OAAO,GAAG,MAAMrB,kBAAkB,CAAC,CAAC;EAC1C,IAAI,CAACoB,OAAO,CAACE,OAAO,EAAEF,OAAO,CAACE,OAAO,GAAG,CAAC,CAAC;EAC1CF,OAAO,CAACE,OAAO,CAACD,OAAO,GAAGA,OAAO;EAEjC,OAAOvB,KAAK,CAACsB,OAAO,CAAC;AACvB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,OAAO,MAAMG,WAAW,GAAGC,KAAK,IAAI;EAClC,IAAI,CAACC,OAAO,EAAE,OAAOD,KAAK;EAC1B,IAAI;IACF,MAAME,SAAS,GAAGF,KAAK,CAACG,QAAQ,CAACzB,IAAI;IACrC,OAAOwB,SAAS,IAAIF,KAAK;EAC3B,CAAC,CAAC,OAAOI,CAAC,EAAE;IACV,OAAOJ,KAAK;EACd;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_","axios","Auth","Config","getSessionTokenAWS","prefix","token","env","AuthStrategy","getAccessToken","isUndefined","getSessionUidAWS","Promise","resolve","reject","currentSession","then","data","accessToken","payload","username","catch","err","console","log","authedFunction","request","authkey","headers","getApiError","error","__DEV__","errorData","response","e"],"sources":["session.js"],"sourcesContent":["import _ from \"lodash\";\nimport axios from \"axios\";\nimport { Auth } from \"aws-amplify\";\nimport Config from \"./config\";\n\nexport const getSessionTokenAWS = async (prefix) => {\n\tconst token = await Config.env.AuthStrategy.getAccessToken();\n\tif (_.isUndefined(prefix)) return token;\n\treturn `${prefix} ${token}`;\n};\n\n// export const getRefreshTokenAWS = async () => {\n// const data = await Auth.currentSession();\n// return data.getRefreshToken().token;\n// };\n\nexport const getSessionUidAWS = () => {\n\treturn new Promise((resolve, reject) => {\n\t\tAuth.currentSession()\n\t\t\t.then((data) => {\n\t\t\t\tresolve(data.accessToken.payload.username);\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tconsole.log(\"getSessionUidAWS error\", err);\n\t\t\t\treject(err);\n\t\t\t});\n\t});\n};\n\nexport const authedFunction = async (request) => {\n\tconst authkey = await getSessionTokenAWS();\n\tif (!request.headers) request.headers = {};\n\trequest.headers.authkey = authkey;\n\n\treturn axios(request);\n};\n\n// export const LogoutAWS = () => {\n// return new Promise((resolve, reject) => {\n// Auth.signOut()\n// .then(() => {\n// resolve();\n// })\n// .catch(err => {\n// reject(err);\n// });\n// });\n// };\n\n// export const isTheBest = auth => {\n// return auth && auth.site === 'plussSpace' && auth.type === 'master';\n// };\n\nexport const getApiError = (error) => {\n\tif (!__DEV__) return error;\n\ttry {\n\t\tconst errorData = error.response.data;\n\t\treturn errorData || error;\n\t} catch (e) {\n\t\treturn error;\n\t}\n};\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AACtB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,aAAa;AAClC,OAAOC,MAAM,MAAM,UAAU;AAE7B,OAAO,MAAMC,kBAAkB,GAAG,MAAOC,MAAM,IAAK;EACnD,MAAMC,KAAK,GAAG,MAAMH,MAAM,CAACI,GAAG,CAACC,YAAY,CAACC,cAAc,CAAC,CAAC;EAC5D,IAAIT,CAAC,CAACU,WAAW,CAACL,MAAM,CAAC,EAAE,OAAOC,KAAK;EACvC,OAAO,GAAGD,MAAM,IAAIC,KAAK,EAAE;AAC5B,CAAC;;AAED;AACA;AACA;AACA;;AAEA,OAAO,MAAMK,gBAAgB,GAAGA,CAAA,KAAM;EACrC,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACvCZ,IAAI,CAACa,cAAc,CAAC,CAAC,CACnBC,IAAI,CAAEC,IAAI,IAAK;MACfJ,OAAO,CAACI,IAAI,CAACC,WAAW,CAACC,OAAO,CAACC,QAAQ,CAAC;IAC3C,CAAC,CAAC,CACDC,KAAK,CAAEC,GAAG,IAAK;MACfC,OAAO,CAACC,GAAG,CAAC,wBAAwB,EAAEF,GAAG,CAAC;MAC1CR,MAAM,CAACQ,GAAG,CAAC;IACZ,CAAC,CAAC;EACJ,CAAC,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,cAAc,GAAG,MAAOC,OAAO,IAAK;EAChD,MAAMC,OAAO,GAAG,MAAMvB,kBAAkB,CAAC,CAAC;EAC1C,IAAI,CAACsB,OAAO,CAACE,OAAO,EAAEF,OAAO,CAACE,OAAO,GAAG,CAAC,CAAC;EAC1CF,OAAO,CAACE,OAAO,CAACD,OAAO,GAAGA,OAAO;EAEjC,OAAO1B,KAAK,CAACyB,OAAO,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,OAAO,MAAMG,WAAW,GAAIC,KAAK,IAAK;EACrC,IAAI,CAACC,OAAO,EAAE,OAAOD,KAAK;EAC1B,IAAI;IACH,MAAME,SAAS,GAAGF,KAAK,CAACG,QAAQ,CAAChB,IAAI;IACrC,OAAOe,SAAS,IAAIF,KAAK;EAC1B,CAAC,CAAC,OAAOI,CAAC,EAAE;IACX,OAAOJ,KAAK;EACb;AACD,CAAC","ignoreList":[]}
@@ -1,31 +1,31 @@
1
- import { StyleSheet } from 'react-native';
2
- import { COLOUR_GREEN } from './colours';
1
+ import { StyleSheet } from "react-native";
2
+ import { COLOUR_GREEN } from "./colours";
3
3
  export default StyleSheet.create({
4
4
  notificationBell: {
5
5
  height: 70,
6
6
  width: 55,
7
- alignItems: 'center',
8
- flexDirection: 'row',
9
- justifyContent: 'space-between'
7
+ alignItems: "center",
8
+ flexDirection: "row",
9
+ justifyContent: "space-between"
10
10
  },
11
11
  fill: {
12
12
  flex: 1
13
13
  },
14
14
  genericPageContainer: {
15
15
  flex: 1,
16
- backgroundColor: '#fff'
16
+ backgroundColor: "#fff"
17
17
  },
18
18
  addButton: {
19
- position: 'absolute',
19
+ position: "absolute",
20
20
  bottom: 16,
21
21
  right: 16,
22
22
  height: 48,
23
23
  width: 48,
24
24
  borderRadius: 23,
25
- justifyContent: 'center',
25
+ justifyContent: "center",
26
26
  zIndex: 200,
27
27
  elevation: 2,
28
- shadowColor: '#000',
28
+ shadowColor: "#000",
29
29
  shadowOffset: {
30
30
  width: 0,
31
31
  height: 2
@@ -34,19 +34,19 @@ export default StyleSheet.create({
34
34
  shadowRadius: 6
35
35
  },
36
36
  addButtonIcon: {
37
- color: '#fff',
37
+ color: "#fff",
38
38
  fontSize: 16,
39
- alignSelf: 'center'
39
+ alignSelf: "center"
40
40
  },
41
41
  backButton: {
42
42
  height: 32,
43
43
  width: 32,
44
44
  borderRadius: 15,
45
- justifyContent: 'center',
46
- alignItems: 'center'
45
+ justifyContent: "center",
46
+ alignItems: "center"
47
47
  },
48
48
  backButtonIcon: {
49
- color: '#fff',
49
+ color: "#fff",
50
50
  fontSize: 18
51
51
  },
52
52
  tickBox: {
@@ -54,11 +54,11 @@ export default StyleSheet.create({
54
54
  width: 20,
55
55
  backgroundColor: COLOUR_GREEN,
56
56
  borderRadius: 10,
57
- justifyContent: 'center',
58
- alignItems: 'center'
57
+ justifyContent: "center",
58
+ alignItems: "center"
59
59
  },
60
60
  tickIcon: {
61
- color: '#fff',
61
+ color: "#fff",
62
62
  fontSize: 17,
63
63
  paddingTop: 1,
64
64
  paddingLeft: 1
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","COLOUR_GREEN","create","notificationBell","height","width","alignItems","flexDirection","justifyContent","fill","flex","genericPageContainer","backgroundColor","addButton","position","bottom","right","borderRadius","zIndex","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","addButtonIcon","color","fontSize","alignSelf","backButton","backButtonIcon","tickBox","tickIcon","paddingTop","paddingLeft"],"sources":["styles.js"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport { COLOUR_GREEN } from './colours';\n\nexport default StyleSheet.create({\n notificationBell: {\n height: 70,\n width: 55,\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n fill: {\n flex: 1,\n },\n genericPageContainer: {\n flex: 1,\n backgroundColor: '#fff',\n },\n addButton: {\n position: 'absolute',\n bottom: 16,\n right: 16,\n height: 48,\n width: 48,\n borderRadius: 23,\n justifyContent: 'center',\n zIndex: 200,\n elevation: 2,\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.15,\n shadowRadius: 6,\n },\n addButtonIcon: {\n color: '#fff',\n fontSize: 16,\n alignSelf: 'center',\n },\n backButton: {\n height: 32,\n width: 32,\n borderRadius: 15,\n justifyContent: 'center',\n alignItems: 'center',\n },\n backButtonIcon: {\n color: '#fff',\n fontSize: 18,\n },\n tickBox: {\n height: 20,\n width: 20,\n backgroundColor: COLOUR_GREEN,\n borderRadius: 10,\n justifyContent: 'center',\n alignItems: 'center',\n },\n tickIcon: {\n color: '#fff',\n fontSize: 17,\n paddingTop: 1,\n paddingLeft: 1,\n },\n});\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,YAAY,QAAQ,WAAW;AAExC,eAAeD,UAAU,CAACE,MAAM,CAAC;EAC/BC,gBAAgB,EAAE;IAChBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDC,IAAI,EAAE;IACJC,IAAI,EAAE;EACR,CAAC;EACDC,oBAAoB,EAAE;IACpBD,IAAI,EAAE,CAAC;IACPE,eAAe,EAAE;EACnB,CAAC;EACDC,SAAS,EAAE;IACTC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTZ,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTY,YAAY,EAAE,EAAE;IAChBT,cAAc,EAAE,QAAQ;IACxBU,MAAM,EAAE,GAAG;IACXC,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEhB,KAAK,EAAE,CAAC;MAAED,MAAM,EAAE;IAAE,CAAC;IACrCkB,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;EAChB,CAAC;EACDC,aAAa,EAAE;IACbC,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE,EAAE;IACZC,SAAS,EAAE;EACb,CAAC;EACDC,UAAU,EAAE;IACVxB,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTY,YAAY,EAAE,EAAE;IAChBT,cAAc,EAAE,QAAQ;IACxBF,UAAU,EAAE;EACd,CAAC;EACDuB,cAAc,EAAE;IACdJ,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE;EACZ,CAAC;EACDI,OAAO,EAAE;IACP1B,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTO,eAAe,EAAEX,YAAY;IAC7BgB,YAAY,EAAE,EAAE;IAChBT,cAAc,EAAE,QAAQ;IACxBF,UAAU,EAAE;EACd,CAAC;EACDyB,QAAQ,EAAE;IACRN,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE,EAAE;IACZM,UAAU,EAAE,CAAC;IACbC,WAAW,EAAE;EACf;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["StyleSheet","COLOUR_GREEN","create","notificationBell","height","width","alignItems","flexDirection","justifyContent","fill","flex","genericPageContainer","backgroundColor","addButton","position","bottom","right","borderRadius","zIndex","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","addButtonIcon","color","fontSize","alignSelf","backButton","backButtonIcon","tickBox","tickIcon","paddingTop","paddingLeft"],"sources":["styles.js"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport { COLOUR_GREEN } from \"./colours\";\n\nexport default StyleSheet.create({\n\tnotificationBell: {\n\t\theight: 70,\n\t\twidth: 55,\n\t\talignItems: \"center\",\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"space-between\",\n\t},\n\tfill: {\n\t\tflex: 1,\n\t},\n\tgenericPageContainer: {\n\t\tflex: 1,\n\t\tbackgroundColor: \"#fff\",\n\t},\n\taddButton: {\n\t\tposition: \"absolute\",\n\t\tbottom: 16,\n\t\tright: 16,\n\t\theight: 48,\n\t\twidth: 48,\n\t\tborderRadius: 23,\n\t\tjustifyContent: \"center\",\n\t\tzIndex: 200,\n\t\televation: 2,\n\t\tshadowColor: \"#000\",\n\t\tshadowOffset: { width: 0, height: 2 },\n\t\tshadowOpacity: 0.15,\n\t\tshadowRadius: 6,\n\t},\n\taddButtonIcon: {\n\t\tcolor: \"#fff\",\n\t\tfontSize: 16,\n\t\talignSelf: \"center\",\n\t},\n\tbackButton: {\n\t\theight: 32,\n\t\twidth: 32,\n\t\tborderRadius: 15,\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t},\n\tbackButtonIcon: {\n\t\tcolor: \"#fff\",\n\t\tfontSize: 18,\n\t},\n\ttickBox: {\n\t\theight: 20,\n\t\twidth: 20,\n\t\tbackgroundColor: COLOUR_GREEN,\n\t\tborderRadius: 10,\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t},\n\ttickIcon: {\n\t\tcolor: \"#fff\",\n\t\tfontSize: 17,\n\t\tpaddingTop: 1,\n\t\tpaddingLeft: 1,\n\t},\n});\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,YAAY,QAAQ,WAAW;AAExC,eAAeD,UAAU,CAACE,MAAM,CAAC;EAChCC,gBAAgB,EAAE;IACjBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EACjB,CAAC;EACDC,IAAI,EAAE;IACLC,IAAI,EAAE;EACP,CAAC;EACDC,oBAAoB,EAAE;IACrBD,IAAI,EAAE,CAAC;IACPE,eAAe,EAAE;EAClB,CAAC;EACDC,SAAS,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTZ,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTY,YAAY,EAAE,EAAE;IAChBT,cAAc,EAAE,QAAQ;IACxBU,MAAM,EAAE,GAAG;IACXC,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEhB,KAAK,EAAE,CAAC;MAAED,MAAM,EAAE;IAAE,CAAC;IACrCkB,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;EACf,CAAC;EACDC,aAAa,EAAE;IACdC,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE,EAAE;IACZC,SAAS,EAAE;EACZ,CAAC;EACDC,UAAU,EAAE;IACXxB,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTY,YAAY,EAAE,EAAE;IAChBT,cAAc,EAAE,QAAQ;IACxBF,UAAU,EAAE;EACb,CAAC;EACDuB,cAAc,EAAE;IACfJ,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE;EACX,CAAC;EACDI,OAAO,EAAE;IACR1B,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTO,eAAe,EAAEX,YAAY;IAC7BgB,YAAY,EAAE,EAAE;IAChBT,cAAc,EAAE,QAAQ;IACxBF,UAAU,EAAE;EACb,CAAC;EACDyB,QAAQ,EAAE;IACTN,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE,EAAE;IACZM,UAAU,EAAE,CAAC;IACbC,WAAW,EAAE;EACd;AACD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
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 { useIsFocused } from "@react-navigation/native";
4
+
5
+ /**
6
+ * Compatibility wrapper for React Navigation v4's withNavigationFocus HOC
7
+ *
8
+ * In v4: withNavigationFocus provided an 'isFocused' prop to class components
9
+ * In v7: useIsFocused hook is the recommended approach for functional components
10
+ *
11
+ * This HOC bridges the gap, allowing class components to continue using
12
+ * the withNavigationFocus pattern while using the v7 useIsFocused hook internally.
13
+ *
14
+ * Usage (unchanged from v4):
15
+ * import { withNavigationFocus } from '@plusscommunities/pluss-core-app';
16
+ * export default withNavigationFocus(connect(mapStateToProps)(MyComponent));
17
+ *
18
+ * The wrapped component receives an 'isFocused' prop that is true when the
19
+ * screen is currently focused and false when not focused.
20
+ */
21
+ export function withNavigationFocus(Component) {
22
+ return function WithNavigationFocusWrapper(props) {
23
+ const isFocused = useIsFocused();
24
+ return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
25
+ isFocused: isFocused
26
+ }));
27
+ };
28
+ }
29
+ export default withNavigationFocus;
30
+ //# sourceMappingURL=withNavigationFocus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useIsFocused","withNavigationFocus","Component","WithNavigationFocusWrapper","props","isFocused","createElement","_extends"],"sources":["withNavigationFocus.js"],"sourcesContent":["import React from \"react\";\nimport { useIsFocused } from \"@react-navigation/native\";\n\n/**\n * Compatibility wrapper for React Navigation v4's withNavigationFocus HOC\n *\n * In v4: withNavigationFocus provided an 'isFocused' prop to class components\n * In v7: useIsFocused hook is the recommended approach for functional components\n *\n * This HOC bridges the gap, allowing class components to continue using\n * the withNavigationFocus pattern while using the v7 useIsFocused hook internally.\n *\n * Usage (unchanged from v4):\n * import { withNavigationFocus } from '@plusscommunities/pluss-core-app';\n * export default withNavigationFocus(connect(mapStateToProps)(MyComponent));\n *\n * The wrapped component receives an 'isFocused' prop that is true when the\n * screen is currently focused and false when not focused.\n */\nexport function withNavigationFocus(Component) {\n\treturn function WithNavigationFocusWrapper(props) {\n\t\tconst isFocused = useIsFocused();\n\n\t\treturn <Component {...props} isFocused={isFocused} />;\n\t};\n}\n\nexport default withNavigationFocus;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,0BAA0B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAACC,SAAS,EAAE;EAC9C,OAAO,SAASC,0BAA0BA,CAACC,KAAK,EAAE;IACjD,MAAMC,SAAS,GAAGL,YAAY,CAAC,CAAC;IAEhC,oBAAOD,KAAA,CAAAO,aAAA,CAACJ,SAAS,EAAAK,QAAA,KAAKH,KAAK;MAAEC,SAAS,EAAEA;IAAU,EAAE,CAAC;EACtD,CAAC;AACF;AAEA,eAAeJ,mBAAmB","ignoreList":[]}
package/package.json CHANGED
@@ -1,70 +1,73 @@
1
1
  {
2
- "name": "@plusscommunities/pluss-core-app",
3
- "version": "8.0.0",
4
- "description": "Core extension package for Pluss Communities platform",
5
- "main": "dist/module/index.js",
6
- "module": "dist/module/index.js",
7
- "react-native": "src/index.js",
8
- "files": [
9
- "dist/",
10
- "src/"
11
- ],
12
- "scripts": {
13
- "build": "npm i && bob build",
14
- "betapatch": "npm version prepatch --preid=beta",
15
- "patch": "npm version patch",
16
- "betaupload": "npm run build && npm publish --access public --tag beta",
17
- "betaupload:p": "npm run betapatch && npm run betaupload",
18
- "upload": "npm run build && npm publish --access public",
19
- "upload:p": "npm run patch && npm run upload"
20
- },
21
- "author": "Thorbjorn Kappel Davis",
22
- "license": "ISC",
23
- "dependencies": {},
24
- "peerDependencies": {
25
- "@expo/vector-icons": "^15.0.3",
26
- "@react-native-async-storage/async-storage": "^2.2.0",
27
- "aws-amplify": "^4.3.11",
28
- "aws-amplify-react-native": "^6.0.2",
29
- "axios": "^1.6.8",
30
- "deprecated-react-native-prop-types": "^4.1.0",
31
- "expo-av": "~16.0.7",
32
- "expo-calendar": "~15.0.7",
33
- "expo-constants": "~18.0.10",
34
- "expo-file-system": "~19.0.17",
35
- "expo-image-manipulator": "~14.0.7",
36
- "expo-image-picker": "~17.0.8",
37
- "expo-linear-gradient": "~15.0.7",
38
- "expo-media-library": "~18.2.0",
39
- "expo-screen-orientation": "~9.0.7",
40
- "expo-sharing": "~14.0.7",
41
- "expo-video-player": "^1.6.0",
42
- "js-cookie": "^2.2.1",
43
- "lodash": "^4.17.4",
44
- "mime-types": "^2.1.24",
45
- "moment": "^2.30.1",
46
- "react": "^19.1.0",
47
- "react-native": "^0.81.5",
48
- "react-native-auto-height-image": "^3.1.3",
49
- "react-native-calendars": "^1.1309.1",
50
- "@rneui/base": "^4.0.0-rc.8",
51
- "@rneui/themed": "^4.0.0-rc.8",
52
- "react-native-gifted-chat": "^0.16.3",
53
- "react-native-image-zoom-viewer": "^3.0.1",
54
- "react-native-iphone-x-helper": "^1.3.1",
55
- "react-native-vimeo-iframe": "^1.0.4",
56
- "react-native-webview": "^13.15.0",
57
- "react-native-youtube-iframe": "^2.2.1",
58
- "react-redux": "^7.2.6"
59
- },
60
- "devDependencies": {
61
- "react-native-builder-bob": "^0.18.2"
62
- },
63
- "react-native-builder-bob": {
64
- "source": "src",
65
- "output": "dist",
66
- "targets": [
67
- "module"
68
- ]
69
- }
2
+ "name": "@plusscommunities/pluss-core-app",
3
+ "version": "8.0.1-auth.0",
4
+ "description": "Core extension package for Pluss Communities platform",
5
+ "main": "dist/module/index.js",
6
+ "module": "dist/module/index.js",
7
+ "react-native": "src/index.js",
8
+ "files": [
9
+ "dist/",
10
+ "src/"
11
+ ],
12
+ "scripts": {
13
+ "build": "npm i && bob build",
14
+ "betapatch": "npm version prepatch --preid=beta",
15
+ "patch": "npm version patch",
16
+ "betaupload": "npm run build && npm publish --access public --tag beta",
17
+ "betaupload:p": "npm run betapatch && npm run betaupload",
18
+ "authpatch": "npm version prepatch --preid=auth",
19
+ "authupload": "npm run build && npm publish --access public --tag auth",
20
+ "authupload:p": "npm run authpatch && npm run authupload",
21
+ "upload": "npm run build && npm publish --access public",
22
+ "upload:p": "npm run patch && npm run upload"
23
+ },
24
+ "author": "Thorbjorn Kappel Davis",
25
+ "license": "ISC",
26
+ "dependencies": {},
27
+ "peerDependencies": {
28
+ "@expo/vector-icons": "*",
29
+ "@react-native-async-storage/async-storage": "*",
30
+ "aws-amplify": "*",
31
+ "aws-amplify-react-native": "*",
32
+ "axios": "*",
33
+ "deprecated-react-native-prop-types": "*",
34
+ "expo-av": "*",
35
+ "expo-calendar": "*",
36
+ "expo-constants": "*",
37
+ "expo-file-system": "*",
38
+ "expo-image-manipulator": "*",
39
+ "expo-image-picker": "*",
40
+ "expo-linear-gradient": "*",
41
+ "expo-media-library": "*",
42
+ "expo-screen-orientation": "*",
43
+ "expo-sharing": "*",
44
+ "expo-video-player": "*",
45
+ "js-cookie": "*",
46
+ "lodash": "*",
47
+ "mime-types": "*",
48
+ "moment": "*",
49
+ "react": "*",
50
+ "react-native": "*",
51
+ "react-native-auto-height-image": "*",
52
+ "react-native-calendars": "*",
53
+ "@rneui/base": "*",
54
+ "@rneui/themed": "*",
55
+ "react-native-gifted-chat": "*",
56
+ "react-native-image-zoom-viewer": "*",
57
+ "react-native-iphone-x-helper": "*",
58
+ "react-native-vimeo-iframe": "*",
59
+ "react-native-webview": "*",
60
+ "react-native-youtube-iframe": "*",
61
+ "react-redux": "*"
62
+ },
63
+ "devDependencies": {
64
+ "react-native-builder-bob": "^0.18.2"
65
+ },
66
+ "react-native-builder-bob": {
67
+ "source": "src",
68
+ "output": "dist",
69
+ "targets": [
70
+ "module"
71
+ ]
72
+ }
70
73
  }
@@ -1,40 +1,44 @@
1
- import _ from 'lodash';
2
- import { LOAD_FOLLOWERS, ADD_FOLLOWER, REMOVE_FOLLOWER } from './types';
3
- import { followerActions } from '../apis/followerActions';
1
+ import _ from "lodash";
2
+ import { LOAD_FOLLOWERS, ADD_FOLLOWER, REMOVE_FOLLOWER } from "./types";
3
+ import { followerActions } from "../apis/followerActions";
4
4
 
5
- export const loadFollowers = followers => {
6
- return {
7
- type: LOAD_FOLLOWERS,
8
- payload: followers,
9
- };
5
+ export const loadFollowers = (followers) => {
6
+ return {
7
+ type: LOAD_FOLLOWERS,
8
+ payload: followers,
9
+ };
10
10
  };
11
11
 
12
- export const getFollowers = userId => {
13
- return async dispatch => {
14
- followerActions
15
- .getFollowing(userId)
16
- .then(res => {
17
- // console.log('getFollowing', res.data);
18
- if (res.data != null && res.data.Items != null && !_.isEmpty(res.data.Items)) {
19
- dispatch(loadFollowers(res.data.Items));
20
- }
21
- })
22
- .catch(error => {
23
- console.log('getFollowing', error);
24
- });
25
- };
12
+ export const getFollowers = (userId) => {
13
+ return async (dispatch) => {
14
+ followerActions
15
+ .getFollowing(userId)
16
+ .then((res) => {
17
+ // console.log('getFollowing', res.data);
18
+ if (
19
+ res.data != null &&
20
+ res.data.Items != null &&
21
+ !_.isEmpty(res.data.Items)
22
+ ) {
23
+ dispatch(loadFollowers(res.data.Items));
24
+ }
25
+ })
26
+ .catch((error) => {
27
+ console.log("getFollowing", error);
28
+ });
29
+ };
26
30
  };
27
31
 
28
- export const addFollower = user => {
29
- return {
30
- type: ADD_FOLLOWER,
31
- payload: user,
32
- };
32
+ export const addFollower = (user) => {
33
+ return {
34
+ type: ADD_FOLLOWER,
35
+ payload: user,
36
+ };
33
37
  };
34
38
 
35
- export const removeFollower = userId => {
36
- return {
37
- type: REMOVE_FOLLOWER,
38
- payload: userId,
39
- };
39
+ export const removeFollower = (userId) => {
40
+ return {
41
+ type: REMOVE_FOLLOWER,
42
+ payload: userId,
43
+ };
40
44
  };