@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.
- package/dist/module/actions/FollowerActions.js +4 -4
- package/dist/module/actions/FollowerActions.js.map +1 -1
- package/dist/module/actions/MediaActions.js +1 -1
- package/dist/module/actions/MediaActions.js.map +1 -1
- package/dist/module/actions/ResidentActions.js +1 -1
- package/dist/module/actions/ResidentActions.js.map +1 -1
- package/dist/module/actions/UserActions.js +1 -1
- package/dist/module/actions/UserActions.js.map +1 -1
- package/dist/module/actions/UserSettingsActions.js +1 -1
- package/dist/module/actions/UserSettingsActions.js.map +1 -1
- package/dist/module/actions/index.js +5 -5
- package/dist/module/actions/index.js.map +1 -1
- package/dist/module/actions/types.js +16 -16
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/analyticsActions.js +5 -5
- package/dist/module/apis/analyticsActions.js.map +1 -1
- package/dist/module/apis/contactActions.js +6 -6
- package/dist/module/apis/contactActions.js.map +1 -1
- package/dist/module/apis/eventActions.js +28 -28
- package/dist/module/apis/eventActions.js.map +1 -1
- package/dist/module/apis/fileActions.js +15 -15
- package/dist/module/apis/fileActions.js.map +1 -1
- package/dist/module/apis/followerActions.js +8 -8
- package/dist/module/apis/followerActions.js.map +1 -1
- package/dist/module/apis/index.js +12 -12
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/apis/notificationActions.js +17 -17
- package/dist/module/apis/notificationActions.js.map +1 -1
- package/dist/module/apis/profileActions.js +4 -4
- package/dist/module/apis/profileActions.js.map +1 -1
- package/dist/module/apis/reactionActions.js +15 -15
- package/dist/module/apis/reactionActions.js.map +1 -1
- package/dist/module/apis/settingActions.js +6 -6
- package/dist/module/apis/settingActions.js.map +1 -1
- package/dist/module/apis/stringActions.js +8 -8
- package/dist/module/apis/stringActions.js.map +1 -1
- package/dist/module/apis/typeActions.js +4 -4
- package/dist/module/apis/typeActions.js.map +1 -1
- package/dist/module/apis/userActions.js +8 -8
- package/dist/module/apis/userActions.js.map +1 -1
- package/dist/module/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
- package/dist/module/colours.js +26 -29
- package/dist/module/colours.js.map +1 -1
- package/dist/module/components/AddButton.js +8 -8
- package/dist/module/components/AddButton.js.map +1 -1
- package/dist/module/components/AddToCalendarButton.js +30 -29
- package/dist/module/components/AddToCalendarButton.js.map +1 -1
- package/dist/module/components/Attachment.js +10 -9
- package/dist/module/components/Attachment.js.map +1 -1
- package/dist/module/components/AudienceSelectorLauncher.js +11 -11
- package/dist/module/components/AudienceSelectorLauncher.js.map +1 -1
- package/dist/module/components/AudienceSelectorPage.js +45 -44
- package/dist/module/components/AudienceSelectorPage.js.map +1 -1
- package/dist/module/components/AutoOffsetImage.js +13 -13
- package/dist/module/components/AutoOffsetImage.js.map +1 -1
- package/dist/module/components/BackButton.js +10 -10
- package/dist/module/components/BackButton.js.map +1 -1
- package/dist/module/components/CalendarPopup.js +21 -21
- package/dist/module/components/CalendarPopup.js.map +1 -1
- package/dist/module/components/CategoryTabs.js +30 -29
- package/dist/module/components/CategoryTabs.js.map +1 -1
- package/dist/module/components/CommentReply.js +43 -37
- package/dist/module/components/CommentReply.js.map +1 -1
- package/dist/module/components/CommentSection.js +74 -74
- package/dist/module/components/CommentSection.js.map +1 -1
- package/dist/module/components/ConfirmPopup.js +21 -20
- package/dist/module/components/ConfirmPopup.js.map +1 -1
- package/dist/module/components/ConfirmationPopup.js +11 -11
- package/dist/module/components/ConfirmationPopup.js.map +1 -1
- package/dist/module/components/DocumentUploader.js +50 -50
- package/dist/module/components/DocumentUploader.js.map +1 -1
- package/dist/module/components/DropDownItem.js +14 -13
- package/dist/module/components/DropDownItem.js.map +1 -1
- package/dist/module/components/DropDownMenu.js +5 -5
- package/dist/module/components/DropDownMenu.js.map +1 -1
- package/dist/module/components/EmptyStateMain.js +10 -9
- package/dist/module/components/EmptyStateMain.js.map +1 -1
- package/dist/module/components/EmptyStateWidget.js +7 -6
- package/dist/module/components/EmptyStateWidget.js.map +1 -1
- package/dist/module/components/FontScaleButton.js +5 -4
- package/dist/module/components/FontScaleButton.js.map +1 -1
- package/dist/module/components/FontScalePopup.js +11 -10
- package/dist/module/components/FontScalePopup.js.map +1 -1
- package/dist/module/components/Forbidden.js +13 -13
- package/dist/module/components/Forbidden.js.map +1 -1
- package/dist/module/components/FormCard.js +4 -4
- package/dist/module/components/FormCard.js.map +1 -1
- package/dist/module/components/FormCardSection.js +20 -18
- package/dist/module/components/FormCardSection.js.map +1 -1
- package/dist/module/components/FormCardSectionOptionLauncher.js +13 -12
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -1
- package/dist/module/components/FormattedText.js +18 -16
- package/dist/module/components/FormattedText.js.map +1 -1
- package/dist/module/components/GenericInput.js +24 -21
- package/dist/module/components/GenericInput.js.map +1 -1
- package/dist/module/components/GenericInputSection.js +27 -26
- package/dist/module/components/GenericInputSection.js.map +1 -1
- package/dist/module/components/Header.js +70 -69
- package/dist/module/components/Header.js.map +1 -1
- package/dist/module/components/Icon.js +109 -0
- package/dist/module/components/Icon.js.map +1 -0
- package/dist/module/components/ImagePopup.js +211 -73
- package/dist/module/components/ImagePopup.js.map +1 -1
- package/dist/module/components/ImageUploadProgress.js +10 -9
- package/dist/module/components/ImageUploadProgress.js.map +1 -1
- package/dist/module/components/ImageUploader.js +116 -96
- package/dist/module/components/ImageUploader.js.map +1 -1
- package/dist/module/components/InlineButton.js +9 -8
- package/dist/module/components/InlineButton.js.map +1 -1
- package/dist/module/components/Input.js +28 -26
- package/dist/module/components/Input.js.map +1 -1
- package/dist/module/components/LoadingCircles.js +20 -20
- package/dist/module/components/LoadingCircles.js.map +1 -1
- package/dist/module/components/LoadingIndicator.js +11 -11
- package/dist/module/components/LoadingIndicator.js.map +1 -1
- package/dist/module/components/LoadingStateWidget.js +5 -5
- package/dist/module/components/LoadingStateWidget.js.map +1 -1
- package/dist/module/components/MediaPlayer.js +31 -31
- package/dist/module/components/MediaPlayer.js.map +1 -1
- package/dist/module/components/MiddlePopup.js +17 -11
- package/dist/module/components/MiddlePopup.js.map +1 -1
- package/dist/module/components/PDFPopup.js +52 -39
- package/dist/module/components/PDFPopup.js.map +1 -1
- package/dist/module/components/PlussChat.js +168 -149
- package/dist/module/components/PlussChat.js.map +1 -1
- package/dist/module/components/PlussChatMessage.js +42 -42
- package/dist/module/components/PlussChatMessage.js.map +1 -1
- package/dist/module/components/PlussChatTime.js +18 -17
- package/dist/module/components/PlussChatTime.js.map +1 -1
- package/dist/module/components/Popup.js +20 -19
- package/dist/module/components/Popup.js.map +1 -1
- package/dist/module/components/PopupMenu.js +15 -14
- package/dist/module/components/PopupMenu.js.map +1 -1
- package/dist/module/components/PositionedImage.js +20 -20
- package/dist/module/components/PositionedImage.js.map +1 -1
- package/dist/module/components/ProfilePic.js +10 -10
- package/dist/module/components/ProfilePic.js.map +1 -1
- package/dist/module/components/RadioButton.js +10 -9
- package/dist/module/components/RadioButton.js.map +1 -1
- package/dist/module/components/Reaction.js +18 -17
- package/dist/module/components/Reaction.js.map +1 -1
- package/dist/module/components/Reactions.js +7 -7
- package/dist/module/components/Reactions.js.map +1 -1
- package/dist/module/components/SharingTools.js +78 -43
- package/dist/module/components/SharingTools.js.map +1 -1
- package/dist/module/components/Spinner.js +5 -5
- package/dist/module/components/Spinner.js.map +1 -1
- package/dist/module/components/StickyFooter.js +6 -6
- package/dist/module/components/StickyFooter.js.map +1 -1
- package/dist/module/components/Text.js +57 -0
- package/dist/module/components/Text.js.map +1 -0
- package/dist/module/components/TickIcon.js +6 -6
- package/dist/module/components/TickIcon.js.map +1 -1
- package/dist/module/components/Toggle.js +10 -9
- package/dist/module/components/Toggle.js.map +1 -1
- package/dist/module/components/TouchableSearchBar.js +18 -17
- package/dist/module/components/TouchableSearchBar.js.map +1 -1
- package/dist/module/components/UserListPopup.js +20 -19
- package/dist/module/components/UserListPopup.js.map +1 -1
- package/dist/module/components/UserListing.js +41 -40
- package/dist/module/components/UserListing.js.map +1 -1
- package/dist/module/components/VideoPopup.js +20 -20
- package/dist/module/components/VideoPopup.js.map +1 -1
- package/dist/module/components/WarningPopup.js +21 -20
- package/dist/module/components/WarningPopup.js.map +1 -1
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +13 -13
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -1
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +24 -23
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -1
- package/dist/module/components/index.js +59 -58
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +94 -64
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -1
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +64 -64
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -1
- package/dist/module/config.js +15 -10
- package/dist/module/config.js.map +1 -1
- package/dist/module/constants.js +3 -4
- package/dist/module/constants.js.map +1 -1
- package/dist/module/helper.js +83 -82
- package/dist/module/helper.js.map +1 -1
- package/dist/module/index.js +12 -12
- package/dist/module/index.js.map +1 -1
- package/dist/module/js/images/detectFaces.js +11 -10
- package/dist/module/js/images/detectFaces.js.map +1 -1
- package/dist/module/js/images/findLandmarkRange.js +8 -8
- package/dist/module/js/images/findLandmarkRange.js.map +1 -1
- package/dist/module/js/images/getScaledOffset.js.map +1 -1
- package/dist/module/js/site/getSiteLevelFromState.js +2 -2
- package/dist/module/js/site/getSiteLevelFromState.js.map +1 -1
- package/dist/module/js/site/isTVEnabled.js +2 -2
- package/dist/module/js/site/isTVEnabled.js.map +1 -1
- package/dist/module/session.js +6 -6
- package/dist/module/session.js.map +1 -1
- package/dist/module/styles.js +17 -17
- package/dist/module/styles.js.map +1 -1
- package/dist/module/withNavigationFocus.js +30 -0
- package/dist/module/withNavigationFocus.js.map +1 -0
- package/package.json +71 -68
- package/src/actions/FollowerActions.js +36 -32
- package/src/actions/MediaActions.js +25 -20
- package/src/actions/ResidentActions.js +26 -21
- package/src/actions/UserActions.js +22 -22
- package/src/actions/UserSettingsActions.js +11 -11
- package/src/actions/index.js +5 -5
- package/src/actions/types.js +16 -16
- package/src/apis/analyticsActions.js +17 -17
- package/src/apis/contactActions.js +20 -20
- package/src/apis/eventActions.js +153 -144
- package/src/apis/fileActions.js +96 -86
- package/src/apis/followerActions.js +29 -29
- package/src/apis/index.js +12 -12
- package/src/apis/notificationActions.js +44 -44
- package/src/apis/profileActions.js +8 -8
- package/src/apis/reactionActions.js +81 -73
- package/src/apis/settingActions.js +15 -15
- package/src/apis/stringActions.js +29 -25
- package/src/apis/typeActions.js +10 -10
- package/src/apis/userActions.js +93 -93
- package/src/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/src/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
- package/src/colours.js +116 -96
- package/src/components/AddButton.js +32 -27
- package/src/components/AddToCalendarButton.js +236 -202
- package/src/components/Attachment.js +59 -36
- package/src/components/AudienceSelectorLauncher.js +52 -48
- package/src/components/AudienceSelectorPage.js +353 -311
- package/src/components/AutoOffsetImage.js +237 -196
- package/src/components/BackButton.js +57 -41
- package/src/components/CalendarPopup.js +127 -97
- package/src/components/CategoryTabs.js +208 -163
- package/src/components/CommentReply.js +370 -309
- package/src/components/CommentSection.js +974 -781
- package/src/components/ConfirmPopup.js +141 -110
- package/src/components/ConfirmationPopup.js +80 -69
- package/src/components/DocumentUploader.js +245 -215
- package/src/components/DropDownItem.js +70 -60
- package/src/components/DropDownMenu.js +31 -27
- package/src/components/EmptyStateMain.js +51 -44
- package/src/components/EmptyStateWidget.js +47 -38
- package/src/components/FontScaleButton.js +29 -25
- package/src/components/FontScalePopup.js +67 -56
- package/src/components/Forbidden.js +48 -46
- package/src/components/FormCard.js +21 -17
- package/src/components/FormCardSection.js +284 -233
- package/src/components/FormCardSectionOptionLauncher.js +72 -46
- package/src/components/FormattedText.js +128 -111
- package/src/components/GenericInput.js +168 -136
- package/src/components/GenericInputSection.js +209 -161
- package/src/components/Header.js +620 -474
- package/src/components/Icon.js +119 -0
- package/src/components/ImagePopup.js +425 -221
- package/src/components/ImageUploadProgress.js +49 -41
- package/src/components/ImageUploader.js +968 -797
- package/src/components/InlineButton.js +79 -69
- package/src/components/Input.js +190 -156
- package/src/components/LoadingCircles.js +233 -233
- package/src/components/LoadingIndicator.js +87 -76
- package/src/components/LoadingStateWidget.js +47 -37
- package/src/components/MediaPlayer.js +416 -387
- package/src/components/MiddlePopup.js +62 -33
- package/src/components/PDFPopup.js +212 -159
- package/src/components/PlussChat.js +1224 -1025
- package/src/components/PlussChatMessage.js +329 -298
- package/src/components/PlussChatTime.js +57 -53
- package/src/components/Popup.js +138 -116
- package/src/components/PopupMenu.js +140 -110
- package/src/components/PositionedImage.js +281 -237
- package/src/components/ProfilePic.js +122 -113
- package/src/components/RadioButton.js +76 -52
- package/src/components/Reaction.js +134 -96
- package/src/components/Reactions.js +65 -63
- package/src/components/SharingTools.js +185 -134
- package/src/components/Spinner.js +13 -13
- package/src/components/StickyFooter.js +36 -26
- package/src/components/Text.js +62 -0
- package/src/components/TickIcon.js +20 -20
- package/src/components/Toggle.js +74 -73
- package/src/components/TouchableSearchBar.js +68 -50
- package/src/components/UserListPopup.js +161 -124
- package/src/components/UserListing.js +273 -238
- package/src/components/VideoPopup.js +110 -96
- package/src/components/WarningPopup.js +92 -71
- package/src/components/expo-image-picker-multiple/ImageBrowser.js +288 -256
- package/src/components/expo-image-picker-multiple/ImageTile.js +108 -84
- package/src/components/index.js +59 -58
- package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +444 -359
- package/src/components/react-native-expo-image-cropper/ImageCropOverlay.js +420 -324
- package/src/config.js +26 -21
- package/src/constants.js +8 -10
- package/src/helper.js +469 -438
- package/src/index.js +24 -12
- package/src/js/images/detectFaces.js +28 -21
- package/src/js/images/findLandmarkRange.js +97 -90
- package/src/js/images/getScaledOffset.js +80 -75
- package/src/js/site/getSiteLevelFromState.js +26 -26
- package/src/js/site/isTVEnabled.js +10 -10
- package/src/session.js +32 -32
- package/src/styles.js +61 -61
- package/src/withNavigationFocus.js +28 -0
- package/dist/module/components/TextStyle.js +0 -45
- package/dist/module/components/TextStyle.js.map +0 -1
- package/dist/module/fonts/index.js +0 -2
- package/dist/module/fonts/index.js.map +0 -1
- package/dist/module/fonts/pluss60-icons.js +0 -5
- package/dist/module/fonts/pluss60-icons.js.map +0 -1
- package/dist/module/fonts/pluss60-icons.json +0 -1097
- package/src/components/TextStyle.js +0 -48
- package/src/fonts/index.js +0 -1
- package/src/fonts/pluss60-icons.js +0 -7
- package/src/fonts/pluss60-icons.json +0 -1097
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stringActions","moment","
|
|
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
|
|
2
|
-
import moment from
|
|
3
|
-
import { stringActions } from
|
|
4
|
-
import detectFaces from
|
|
5
|
-
import getScaledOffset from
|
|
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(
|
|
12
|
+
const response = await stringActions.getString("plussSpace", `imagefaces_${encodeURIComponent(url)}`);
|
|
13
13
|
cachedValues = response.data;
|
|
14
14
|
} catch (e) {
|
|
15
|
-
console.log(
|
|
15
|
+
console.log("errored from cache");
|
|
16
16
|
}
|
|
17
|
-
if (!cachedValues || !cachedValues.faces || !cachedValues.image || _.isEmpty(cachedValues.faces) && moment().add(-1,
|
|
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
|
|
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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;MACxB;IACD,CAAC,CAAC;EACH;EAEA,IAAIC,WAAW,GAAGpB,KAAK,CAACS,KAAK;EAC7B,IAAIY,YAAY,GAAGrB,KAAK,CAACU,MAAM;EAE/B,IAAIpB,OAAO,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 = (
|
|
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;EACA,IAAIC,WAAW,GAAGC,WAAW,EAAE;IAC9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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
|
|
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
|
|
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
|
|
1
|
+
import _ from "lodash";
|
|
2
2
|
const isTVEnabled = (interfaces, feature) => {
|
|
3
3
|
return _.some(interfaces, t => {
|
|
4
|
-
return t.Type ===
|
|
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
|
|
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":[]}
|
package/dist/module/session.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _ from
|
|
2
|
-
import axios from
|
|
3
|
-
import { Auth } from
|
|
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
|
|
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(
|
|
21
|
+
console.log("getSessionUidAWS error", err);
|
|
22
22
|
reject(err);
|
|
23
23
|
});
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_","axios","Auth","
|
|
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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,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":[]}
|
package/dist/module/styles.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { StyleSheet } from
|
|
2
|
-
import { COLOUR_GREEN } from
|
|
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:
|
|
8
|
-
flexDirection:
|
|
9
|
-
justifyContent:
|
|
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:
|
|
16
|
+
backgroundColor: "#fff"
|
|
17
17
|
},
|
|
18
18
|
addButton: {
|
|
19
|
-
position:
|
|
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:
|
|
25
|
+
justifyContent: "center",
|
|
26
26
|
zIndex: 200,
|
|
27
27
|
elevation: 2,
|
|
28
|
-
shadowColor:
|
|
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:
|
|
37
|
+
color: "#fff",
|
|
38
38
|
fontSize: 16,
|
|
39
|
-
alignSelf:
|
|
39
|
+
alignSelf: "center"
|
|
40
40
|
},
|
|
41
41
|
backButton: {
|
|
42
42
|
height: 32,
|
|
43
43
|
width: 32,
|
|
44
44
|
borderRadius: 15,
|
|
45
|
-
justifyContent:
|
|
46
|
-
alignItems:
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
alignItems: "center"
|
|
47
47
|
},
|
|
48
48
|
backButtonIcon: {
|
|
49
|
-
color:
|
|
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:
|
|
58
|
-
alignItems:
|
|
57
|
+
justifyContent: "center",
|
|
58
|
+
alignItems: "center"
|
|
59
59
|
},
|
|
60
60
|
tickIcon: {
|
|
61
|
-
color:
|
|
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
|
|
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\t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AAY,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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
|
2
|
-
import { LOAD_FOLLOWERS, ADD_FOLLOWER, REMOVE_FOLLOWER } from
|
|
3
|
-
import { followerActions } from
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
export const removeFollower = (userId) => {
|
|
40
|
+
return {
|
|
41
|
+
type: REMOVE_FOLLOWER,
|
|
42
|
+
payload: userId,
|
|
43
|
+
};
|
|
40
44
|
};
|