@monkvision/inspection-capture-web 4.0.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/LICENSE +32 -0
- package/README.md +97 -0
- package/lib/PhotoCapture/PhotoCapture.d.ts +44 -0
- package/lib/PhotoCapture/PhotoCapture.js +179 -0
- package/lib/PhotoCapture/PhotoCapture.js.map +1 -0
- package/lib/PhotoCapture/PhotoCapture.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCapture.styles.js +34 -0
- package/lib/PhotoCapture/PhotoCapture.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHOC.d.ts +40 -0
- package/lib/PhotoCapture/PhotoCaptureHOC.js +60 -0
- package/lib/PhotoCapture/PhotoCaptureHOC.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.d.ts +88 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.js +51 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.styles.js +25 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.d.ts +66 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.js +44 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.styles.d.ts +5 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.styles.js +72 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/hooks.d.ts +25 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/hooks.js +45 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/hooks.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/index.d.ts +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/index.js +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/PhotoCaptureHUDCancelButton.d.ts +13 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/PhotoCaptureHUDCancelButton.js +29 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/PhotoCaptureHUDCancelButton.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/index.d.ts +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/index.js +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.d.ts +5 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.js +28 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.styles.js +17 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/hooks.d.ts +24 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/hooks.js +17 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/hooks.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/index.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/index.js +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/PhotoCaptureHUDElements.d.ts +63 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/PhotoCaptureHUDElements.js +25 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/PhotoCaptureHUDElements.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/index.d.ts +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/index.js +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.d.ts +14 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.js +39 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.styles.js +46 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/hooks.d.ts +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/hooks.js +25 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/hooks.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/index.d.ts +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/index.js +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.d.ts +19 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.js +41 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.styles.js +78 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/hooks.d.ts +7 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/hooks.js +26 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/hooks.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/index.d.ts +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/index.js +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/AddDamageButton.d.ts +19 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/AddDamageButton.js +29 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/AddDamageButton.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/index.d.ts +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/index.js +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.d.ts +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.js +35 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.styles.js +40 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.d.ts +14 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.js +37 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.styles.js +28 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/index.d.ts +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/index.js +18 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSlider.d.ts +36 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSlider.js +63 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSlider.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSlider.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSlider.styles.js +30 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSlider.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSliderButton.d.ts +26 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSliderButton.js +67 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSliderButton.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/hooks.d.ts +5 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/hooks.js +24 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/hooks.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/index.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/index.js +8 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/hooks.d.ts +867 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/hooks.js +38 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/hooks.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/index.d.ts +5 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/index.js +23 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.d.ts +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.js +37 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.styles.js +40 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/hooks.d.ts +28 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/hooks.js +58 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/hooks.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/index.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/index.js +6 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/ArrowIcon.d.ts +5 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/ArrowIcon.js +20 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/ArrowIcon.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/DisplayText.d.ts +5 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/DisplayText.js +25 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/DisplayText.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.d.ts +27 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.js +37 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.styles.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.styles.js +68 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.styles.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/index.d.ts +3 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/index.js +10 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/index.d.ts +2 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/index.js +19 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/index.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDButtonBackground.d.ts +4 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDButtonBackground.js +14 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDButtonBackground.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDStyle.d.ts +814 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDStyle.js +25 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDStyle.js.map +1 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/index.d.ts +11 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/index.js +30 -0
- package/lib/PhotoCapture/PhotoCaptureHUD/index.js.map +1 -0
- package/lib/PhotoCapture/errors.d.ts +3 -0
- package/lib/PhotoCapture/errors.js +8 -0
- package/lib/PhotoCapture/errors.js.map +1 -0
- package/lib/PhotoCapture/hooks/index.d.ts +11 -0
- package/lib/PhotoCapture/hooks/index.js +28 -0
- package/lib/PhotoCapture/hooks/index.js.map +1 -0
- package/lib/PhotoCapture/hooks/useAdaptiveCameraConfig.d.ts +29 -0
- package/lib/PhotoCapture/hooks/useAdaptiveCameraConfig.js +80 -0
- package/lib/PhotoCapture/hooks/useAdaptiveCameraConfig.js.map +1 -0
- package/lib/PhotoCapture/hooks/useAddDamageMode.d.ts +42 -0
- package/lib/PhotoCapture/hooks/useAddDamageMode.js +58 -0
- package/lib/PhotoCapture/hooks/useAddDamageMode.js.map +1 -0
- package/lib/PhotoCapture/hooks/useBadConnectionWarning.d.ts +27 -0
- package/lib/PhotoCapture/hooks/useBadConnectionWarning.js +38 -0
- package/lib/PhotoCapture/hooks/useBadConnectionWarning.js.map +1 -0
- package/lib/PhotoCapture/hooks/useComplianceAnalytics.d.ts +20 -0
- package/lib/PhotoCapture/hooks/useComplianceAnalytics.js +54 -0
- package/lib/PhotoCapture/hooks/useComplianceAnalytics.js.map +1 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureImages.d.ts +5 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureImages.js +14 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureImages.js.map +1 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureSightState.d.ts +80 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureSightState.js +201 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureSightState.js.map +1 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureTutorial.d.ts +36 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureTutorial.js +67 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureTutorial.js.map +1 -0
- package/lib/PhotoCapture/hooks/usePictureTaken.d.ts +35 -0
- package/lib/PhotoCapture/hooks/usePictureTaken.js +45 -0
- package/lib/PhotoCapture/hooks/usePictureTaken.js.map +1 -0
- package/lib/PhotoCapture/hooks/useStartTasksOnComplete.d.ts +33 -0
- package/lib/PhotoCapture/hooks/useStartTasksOnComplete.js +100 -0
- package/lib/PhotoCapture/hooks/useStartTasksOnComplete.js.map +1 -0
- package/lib/PhotoCapture/hooks/useTracking.d.ts +17 -0
- package/lib/PhotoCapture/hooks/useTracking.js +29 -0
- package/lib/PhotoCapture/hooks/useTracking.js.map +1 -0
- package/lib/PhotoCapture/hooks/useUploadQueue.d.ts +95 -0
- package/lib/PhotoCapture/hooks/useUploadQueue.js +117 -0
- package/lib/PhotoCapture/hooks/useUploadQueue.js.map +1 -0
- package/lib/PhotoCapture/index.d.ts +3 -0
- package/lib/PhotoCapture/index.js +21 -0
- package/lib/PhotoCapture/index.js.map +1 -0
- package/lib/assets/arrows.asset.d.ts +2 -0
- package/lib/assets/arrows.asset.js +6 -0
- package/lib/assets/arrows.asset.js.map +1 -0
- package/lib/assets/crosshair.asset.d.ts +1 -0
- package/lib/assets/crosshair.asset.js +5 -0
- package/lib/assets/crosshair.asset.js.map +1 -0
- package/lib/assets/index.d.ts +2 -0
- package/lib/assets/index.js +19 -0
- package/lib/assets/index.js.map +1 -0
- package/lib/i18n.d.ts +6 -0
- package/lib/i18n.js +25 -0
- package/lib/i18n.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/lib/translations/de.json +45 -0
- package/lib/translations/en.json +45 -0
- package/lib/translations/fr.json +45 -0
- package/lib/translations/nl.json +45 -0
- package/package.json +94 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
The Clear BSD License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2022] [Monk](http://monk.ai)
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted (subject to the limitations in the disclaimer
|
|
8
|
+
below) provided that the following conditions are met:
|
|
9
|
+
|
|
10
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer.
|
|
12
|
+
|
|
13
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
documentation and/or other materials provided with the distribution.
|
|
16
|
+
|
|
17
|
+
* Neither the name of the copyright holder nor the names of its
|
|
18
|
+
contributors may be used to endorse or promote products derived from this
|
|
19
|
+
software without specific prior written permission.
|
|
20
|
+
|
|
21
|
+
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
|
|
22
|
+
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
23
|
+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
25
|
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
26
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
27
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
28
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
29
|
+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
30
|
+
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
31
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
32
|
+
POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# @monkvision/inspection-capture-web
|
|
2
|
+
This package provides utils, tools and ready-to-use components used to capture pictures needed to run Monk inspections.
|
|
3
|
+
There are two main workflows for capturing pictures of a vehicle for a Monk inspection :
|
|
4
|
+
- The **PhotoCapture** workflow : the user is shown a certain set of car wireframes, called *Sights*, and they are asked
|
|
5
|
+
to take pictures of the vehicle by aligning the vehicle with the Sight overlays.
|
|
6
|
+
- The **VideoCapture** workflow : the user is asked to record a quick video of their vehicle by filming it and rotating
|
|
7
|
+
in a full circle around it.
|
|
8
|
+
|
|
9
|
+
# Installing
|
|
10
|
+
To install the package, you can run the following command :
|
|
11
|
+
|
|
12
|
+
```shell
|
|
13
|
+
yarn add @monkvision/inspection-capture-web
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
If you are using TypeScript, this package comes with its type definitions integrated, so you don't need to install
|
|
17
|
+
anything else!
|
|
18
|
+
|
|
19
|
+
# PhotoCapture
|
|
20
|
+
The PhotoCapture wofklow is aimed at guiding users in taking pictures of their vehicle in order to add them to a Monk
|
|
21
|
+
inspection. The user is shown a set of car wireframes, which we call *Sights* and that are available in the
|
|
22
|
+
`@monkvision/sights` package. These Sights act as guides, and the user is asked to take pictures of their vehicle by
|
|
23
|
+
aligning it with the Sights.
|
|
24
|
+
|
|
25
|
+
Please refer to the [official MonkJs documentation](https://monkvision.github.io/monkjs/docs/photo-capture-workflow) to
|
|
26
|
+
have a detailed overview of the Photo Capture workflow.
|
|
27
|
+
|
|
28
|
+
## PhotoCapture component
|
|
29
|
+
This package exports a ready-to-use single-page component called `PhotoCapture` that implements the PhotoCapture
|
|
30
|
+
workflow. In order to use it, simply create a new page in your application containing just this component. You will then
|
|
31
|
+
need to generate a Monk authentication token (using Auth0), and create a new inspection, in which all tasks statuses are
|
|
32
|
+
set to `NOT_STARTED` (so that we can add images to them later). You can then pass the api config (with the auth token),
|
|
33
|
+
the inspection ID, as well as a list of Sights (to display to the user) to the `PhotoCapture` component. Once the user
|
|
34
|
+
has completed the capture workflow, the `onComplete` callback will be called, and you will then be able to navigate to
|
|
35
|
+
another page. The complete list of configuration props for this component is available at the end of this section.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { sights } from '@monkvision/sights';
|
|
39
|
+
import { PhotoCapture } from '@monkvision/inspection-capture-web';
|
|
40
|
+
|
|
41
|
+
const PHOTO_CAPTURE_SIGHTS = [
|
|
42
|
+
sights['fesc20-0mJeXBDf'],
|
|
43
|
+
sights['fesc20-26n47kaO'],
|
|
44
|
+
sights['fesc20-2bLRuhEQ'],
|
|
45
|
+
sights['fesc20-4Wqx52oU'],
|
|
46
|
+
sights['fesc20-Tlu3sz8A'],
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const apiDomain = 'api.preview.monk.ai/v1';
|
|
50
|
+
|
|
51
|
+
export function MonkPhotoCapturePage({ authToken }) {
|
|
52
|
+
return (
|
|
53
|
+
<PhotoCapture
|
|
54
|
+
inspectionId={inspectionId}
|
|
55
|
+
apiConfig={{ apiDomain, authToken }}
|
|
56
|
+
sights={PHOTO_CAPTURE_SIGHTS}
|
|
57
|
+
onComplete={() => { /* Navigate to another page */ }}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
| Prop | Type | Description | Required | Default Value |
|
|
64
|
+
|------------------------------------|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------------------------------------------|
|
|
65
|
+
| sights | Sight[] | The list of Sights to take pictures of. The values in this array should be retreived from the `@monkvision/sights` package. | ✔️ | |
|
|
66
|
+
| inspectionId | string | The ID of the inspection to add images to. Make sure that the user that created the inspection if the same one as the one described in the auth token in the `apiConfig` prop. | ✔️ | |
|
|
67
|
+
| apiConfig | ApiConfig | The api config used to communicate with the API. Make sure that the user described in the auth token is the same one as the one that created the inspection provided in the `inspectionId` prop. | ✔️ | |
|
|
68
|
+
| onClose | `() => void` | Callback called when the user clicks on the Close button. If this callback is not provided, the button will not be displayed on the screen. | | |
|
|
69
|
+
| onComplete | `() => void` | Callback called when inspection capture is complete. | | |
|
|
70
|
+
| lang | <code>string | null</code> | The language to be used by this component. | | `'en'` |
|
|
71
|
+
| enforceOrientation | `DeviceOrientation` | Use this prop to enforce a specific device orientation for the Camera screen. | | |
|
|
72
|
+
| maxUploadDurationWarning | `number` | Max upload duration in milliseconds before showing a bad connection warning to the user. Use `-1` to never display the warning. | | `15000` |
|
|
73
|
+
| useAdaptiveImageQuality | `boolean` | Boolean indicating if the image quality should be downgraded automatically in case of low connection. | | `true` |
|
|
74
|
+
| showCloseButton | `boolean` | Indicates if the close button should be displayed in the HUD on top of the Camera preview. | | `false` |
|
|
75
|
+
| startTasksOnComplete | `<code>boolean | TaskName[]</code>` | Value indicating if tasks should be started at the end of the inspection. See the `inspection-capture-web` package doc for more info. | | `true` |
|
|
76
|
+
| additionalTasks | `TaskName[]` | An optional list of additional tasks to run on every Sight of the inspection. | | |
|
|
77
|
+
| tasksBySight | `Record<string, TaskName[]>` | Record associating each sight with a list of tasks to execute for it. If not provided, the default tasks of the sight will be used. | | |
|
|
78
|
+
| format | `CompressionFormat` | The output format of the compression. | | `CompressionFormat.JPEG` |
|
|
79
|
+
| quality | `number` | Value indicating image quality for the compression output. | | `0.6` |
|
|
80
|
+
| resolution | `CameraResolution` | Indicates the resolution of the pictures taken by the Camera. | | `CameraResolution.UHD_4K` |
|
|
81
|
+
| allowImageUpscaling | `boolean` | Allow images to be scaled up if the device does not support the specified resolution in the `resolution` prop. | | `false` |
|
|
82
|
+
| allowSkipRetake | `boolean` | If compliance is enabled, this prop indicate if the user is allowed to skip the retaking process if some pictures are not compliant. | | `false` |
|
|
83
|
+
| enableCompliance | `boolean` | Indicates if compliance checks should be enabled or not. | | `true` |
|
|
84
|
+
| enableCompliancePerSight | `string[]` | Array of Sight IDs that indicates for which sight IDs the compliance should be enabled. | | |
|
|
85
|
+
| complianceIssues | `ComplianceIssue[]` | If compliance checks are enabled, this property can be used to select a list of compliance issues to check. | | `DEFAULT_COMPLIANCE_ISSUES` |
|
|
86
|
+
| complianceIssuesPerSight | `Record<string, ComplianceIssue[]>` | A map associating Sight IDs to a list of compliance issues to check. | | |
|
|
87
|
+
| useLiveCompliance | `boolean` | Indicates if live compliance should be enabled or not. | | `false` |
|
|
88
|
+
| customComplianceThresholds | `CustomComplianceThresholds` | Custom thresholds that can be used to modify the strictness of the compliance for certain compliance issues. | | |
|
|
89
|
+
| customComplianceThresholdsPerSight | `Record<string, CustomComplianceThresholds>` | A map associating Sight IDs to custom compliance thresholds. | | |
|
|
90
|
+
| validateButtonLabel | `string` | Custom label for validate button in gallery view. | | |
|
|
91
|
+
| enableSightGuideline | `boolean` | Boolean indicating whether the sight guideline feature is enabled. If disabled, the guideline text will be hidden. | | `true` |
|
|
92
|
+
| sightGuidelines | `sightGuideline[]` | A collection of sight guidelines in different language with a list of sightIds associate to it. | | |
|
|
93
|
+
| enableTutorial | `PhotoCaptureTutorialOption` | Options for displaying the photo capture tutorial. | | `PhotoCaptureTutorialOption.FIRST_TIME_ONLY` |
|
|
94
|
+
| allowSkipTutorial | `boolean` | Boolean indicating if the user can skip the PhotoCapture tutorial. | | `true` |
|
|
95
|
+
| thumbnailDomain | `string` | The API domain used to communicate with the resize micro service. | ✔️ | |
|
|
96
|
+
|
|
97
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CameraProps } from '@monkvision/camera-web';
|
|
2
|
+
import { MonkApiConfig } from '@monkvision/network';
|
|
3
|
+
import { CameraConfig, CaptureAppConfig, ComplianceOptions, CompressionOptions, Sight } from '@monkvision/types';
|
|
4
|
+
import { PhotoCaptureHUDProps } from './PhotoCaptureHUD';
|
|
5
|
+
/**
|
|
6
|
+
* Props of the PhotoCapture component.
|
|
7
|
+
*/
|
|
8
|
+
export interface PhotoCaptureProps extends Pick<CameraProps<PhotoCaptureHUDProps>, 'resolution' | 'allowImageUpscaling'>, Pick<CaptureAppConfig, keyof CameraConfig | 'maxUploadDurationWarning' | 'useAdaptiveImageQuality' | 'additionalTasks' | 'tasksBySight' | 'startTasksOnComplete' | 'showCloseButton' | 'enforceOrientation' | 'allowSkipRetake' | 'enableAddDamage' | 'sightGuidelines' | 'enableSightGuidelines' | 'enableTutorial' | 'allowSkipTutorial' | 'enableSightTutorial'>, Partial<CompressionOptions>, Partial<ComplianceOptions> {
|
|
9
|
+
/**
|
|
10
|
+
* The list of sights to take pictures of. The values in this array should be retreived from the `@monkvision/sights`
|
|
11
|
+
* package.
|
|
12
|
+
*/
|
|
13
|
+
sights: Sight[];
|
|
14
|
+
/**
|
|
15
|
+
* The ID of the inspection to add images to. Make sure that the user that created the inspection if the same one as
|
|
16
|
+
* the one described in the auth token in the `apiConfig` prop.
|
|
17
|
+
*/
|
|
18
|
+
inspectionId: string;
|
|
19
|
+
/**
|
|
20
|
+
* The api config used to communicate with the API. Make sure that the user described in the auth token is the same
|
|
21
|
+
* one as the one that created the inspection provided in the `inspectionId` prop.
|
|
22
|
+
*/
|
|
23
|
+
apiConfig: MonkApiConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Callback called when the user clicks on the Close button. If this callback is not provided, the button will not be
|
|
26
|
+
* displayed on the screen.
|
|
27
|
+
*/
|
|
28
|
+
onClose?: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Callback called when inspection capture is complete.
|
|
31
|
+
*/
|
|
32
|
+
onComplete?: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* The language to be used by this component.
|
|
35
|
+
*
|
|
36
|
+
* @default en
|
|
37
|
+
*/
|
|
38
|
+
lang?: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Custom label for validate button in gallery view.
|
|
41
|
+
*/
|
|
42
|
+
validateButtonLabel?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare function PhotoCapture({ sights, inspectionId, apiConfig, additionalTasks, tasksBySight, startTasksOnComplete, onClose, onComplete, maxUploadDurationWarning, showCloseButton, enableCompliance, enableCompliancePerSight, complianceIssues, complianceIssuesPerSight, customComplianceThresholds, customComplianceThresholdsPerSight, useLiveCompliance, allowSkipRetake, enableAddDamage, sightGuidelines, enableTutorial, allowSkipTutorial, enableSightTutorial, enableSightGuidelines, useAdaptiveImageQuality, lang, enforceOrientation, validateButtonLabel, ...initialCameraConfig }: PhotoCaptureProps): JSX.Element;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.PhotoCapture = void 0;
|
|
26
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
var analytics_1 = require("@monkvision/analytics");
|
|
28
|
+
var camera_web_1 = require("@monkvision/camera-web");
|
|
29
|
+
var common_1 = require("@monkvision/common");
|
|
30
|
+
var common_ui_web_1 = require("@monkvision/common-ui-web");
|
|
31
|
+
var monitoring_1 = require("@monkvision/monitoring");
|
|
32
|
+
var types_1 = require("@monkvision/types");
|
|
33
|
+
var react_1 = require("react");
|
|
34
|
+
var react_i18next_1 = require("react-i18next");
|
|
35
|
+
var PhotoCapture_styles_1 = require("./PhotoCapture.styles");
|
|
36
|
+
var PhotoCaptureHUD_1 = require("./PhotoCaptureHUD");
|
|
37
|
+
var hooks_1 = require("./hooks");
|
|
38
|
+
var PhotoCaptureScreen;
|
|
39
|
+
(function (PhotoCaptureScreen) {
|
|
40
|
+
PhotoCaptureScreen["CAMERA"] = "camera";
|
|
41
|
+
PhotoCaptureScreen["GALLERY"] = "gallery";
|
|
42
|
+
})(PhotoCaptureScreen || (PhotoCaptureScreen = {}));
|
|
43
|
+
// No ts-doc for this component : the component exported is PhotoCaptureHOC
|
|
44
|
+
function PhotoCapture(_a) {
|
|
45
|
+
var sights = _a.sights, inspectionId = _a.inspectionId, apiConfig = _a.apiConfig, additionalTasks = _a.additionalTasks, tasksBySight = _a.tasksBySight, _b = _a.startTasksOnComplete, startTasksOnComplete = _b === void 0 ? true : _b, onClose = _a.onClose, onComplete = _a.onComplete, _c = _a.maxUploadDurationWarning, maxUploadDurationWarning = _c === void 0 ? 15000 : _c, _d = _a.showCloseButton, showCloseButton = _d === void 0 ? false : _d, _e = _a.enableCompliance, enableCompliance = _e === void 0 ? true : _e, enableCompliancePerSight = _a.enableCompliancePerSight, complianceIssues = _a.complianceIssues, complianceIssuesPerSight = _a.complianceIssuesPerSight, customComplianceThresholds = _a.customComplianceThresholds, customComplianceThresholdsPerSight = _a.customComplianceThresholdsPerSight, _f = _a.useLiveCompliance, useLiveCompliance = _f === void 0 ? false : _f, _g = _a.allowSkipRetake, allowSkipRetake = _g === void 0 ? false : _g, _h = _a.enableAddDamage, enableAddDamage = _h === void 0 ? true : _h, sightGuidelines = _a.sightGuidelines, _j = _a.enableTutorial, enableTutorial = _j === void 0 ? types_1.PhotoCaptureTutorialOption.FIRST_TIME_ONLY : _j, _k = _a.allowSkipTutorial, allowSkipTutorial = _k === void 0 ? true : _k, _l = _a.enableSightTutorial, enableSightTutorial = _l === void 0 ? true : _l, _m = _a.enableSightGuidelines, enableSightGuidelines = _m === void 0 ? true : _m, _o = _a.useAdaptiveImageQuality, useAdaptiveImageQuality = _o === void 0 ? true : _o, lang = _a.lang, enforceOrientation = _a.enforceOrientation, validateButtonLabel = _a.validateButtonLabel, initialCameraConfig = __rest(_a, ["sights", "inspectionId", "apiConfig", "additionalTasks", "tasksBySight", "startTasksOnComplete", "onClose", "onComplete", "maxUploadDurationWarning", "showCloseButton", "enableCompliance", "enableCompliancePerSight", "complianceIssues", "complianceIssuesPerSight", "customComplianceThresholds", "customComplianceThresholdsPerSight", "useLiveCompliance", "allowSkipRetake", "enableAddDamage", "sightGuidelines", "enableTutorial", "allowSkipTutorial", "enableSightTutorial", "enableSightGuidelines", "useAdaptiveImageQuality", "lang", "enforceOrientation", "validateButtonLabel"]);
|
|
46
|
+
(0, common_1.useI18nSync)(lang);
|
|
47
|
+
var complianceOptions = (0, common_1.useObjectMemo)({
|
|
48
|
+
enableCompliance: enableCompliance,
|
|
49
|
+
enableCompliancePerSight: enableCompliancePerSight,
|
|
50
|
+
complianceIssues: complianceIssues,
|
|
51
|
+
complianceIssuesPerSight: complianceIssuesPerSight,
|
|
52
|
+
useLiveCompliance: useLiveCompliance,
|
|
53
|
+
customComplianceThresholds: customComplianceThresholds,
|
|
54
|
+
customComplianceThresholdsPerSight: customComplianceThresholdsPerSight,
|
|
55
|
+
});
|
|
56
|
+
var t = (0, react_i18next_1.useTranslation)().t;
|
|
57
|
+
var monitoring = (0, monitoring_1.useMonitoring)();
|
|
58
|
+
var _p = (0, react_1.useState)(PhotoCaptureScreen.CAMERA), currentScreen = _p[0], setCurrentScreen = _p[1];
|
|
59
|
+
var dimensions = (0, common_1.useWindowDimensions)();
|
|
60
|
+
var analytics = (0, analytics_1.useAnalytics)();
|
|
61
|
+
var loading = (0, common_1.useLoadingState)();
|
|
62
|
+
var addDamageHandle = (0, hooks_1.useAddDamageMode)();
|
|
63
|
+
(0, hooks_1.useTracking)({ inspectionId: inspectionId, authToken: apiConfig.authToken });
|
|
64
|
+
var setIsInitialInspectionFetched = (0, hooks_1.useComplianceAnalytics)({ inspectionId: inspectionId, sights: sights }).setIsInitialInspectionFetched;
|
|
65
|
+
var _q = (0, hooks_1.useAdaptiveCameraConfig)({
|
|
66
|
+
initialCameraConfig: initialCameraConfig,
|
|
67
|
+
useAdaptiveImageQuality: useAdaptiveImageQuality,
|
|
68
|
+
}), adaptiveCameraConfig = _q.adaptiveCameraConfig, adaptiveUploadEventHandlers = _q.uploadEventHandlers;
|
|
69
|
+
var startTasks = (0, hooks_1.useStartTasksOnComplete)({
|
|
70
|
+
inspectionId: inspectionId,
|
|
71
|
+
apiConfig: apiConfig,
|
|
72
|
+
sights: sights,
|
|
73
|
+
additionalTasks: additionalTasks,
|
|
74
|
+
tasksBySight: tasksBySight,
|
|
75
|
+
startTasksOnComplete: startTasksOnComplete,
|
|
76
|
+
loading: loading,
|
|
77
|
+
});
|
|
78
|
+
var onLastSightTaken = function () {
|
|
79
|
+
setCurrentScreen(PhotoCaptureScreen.GALLERY);
|
|
80
|
+
};
|
|
81
|
+
var sightState = (0, hooks_1.usePhotoCaptureSightState)({
|
|
82
|
+
inspectionId: inspectionId,
|
|
83
|
+
captureSights: sights,
|
|
84
|
+
apiConfig: apiConfig,
|
|
85
|
+
loading: loading,
|
|
86
|
+
onLastSightTaken: onLastSightTaken,
|
|
87
|
+
tasksBySight: tasksBySight,
|
|
88
|
+
complianceOptions: complianceOptions,
|
|
89
|
+
setIsInitialInspectionFetched: setIsInitialInspectionFetched,
|
|
90
|
+
});
|
|
91
|
+
var _r = (0, hooks_1.usePhotoCaptureTutorial)({
|
|
92
|
+
enableTutorial: enableTutorial,
|
|
93
|
+
enableSightGuidelines: enableSightGuidelines,
|
|
94
|
+
enableSightTutorial: enableSightTutorial,
|
|
95
|
+
}), currentTutorialStep = _r.currentTutorialStep, goToNextTutorialStep = _r.goToNextTutorialStep, closeTutorial = _r.closeTutorial;
|
|
96
|
+
var _s = (0, hooks_1.useBadConnectionWarning)({ maxUploadDurationWarning: maxUploadDurationWarning }), isBadConnectionWarningDialogDisplayed = _s.isBadConnectionWarningDialogDisplayed, closeBadConnectionWarningDialog = _s.closeBadConnectionWarningDialog, badConnectionWarningUploadEventHandlers = _s.uploadEventHandlers;
|
|
97
|
+
var uploadQueue = (0, hooks_1.useUploadQueue)({
|
|
98
|
+
inspectionId: inspectionId,
|
|
99
|
+
apiConfig: apiConfig,
|
|
100
|
+
additionalTasks: additionalTasks,
|
|
101
|
+
complianceOptions: complianceOptions,
|
|
102
|
+
eventHandlers: [adaptiveUploadEventHandlers, badConnectionWarningUploadEventHandlers],
|
|
103
|
+
});
|
|
104
|
+
var images = (0, hooks_1.usePhotoCaptureImages)(inspectionId);
|
|
105
|
+
var handlePictureTaken = (0, hooks_1.usePictureTaken)({
|
|
106
|
+
sightState: sightState,
|
|
107
|
+
addDamageHandle: addDamageHandle,
|
|
108
|
+
uploadQueue: uploadQueue,
|
|
109
|
+
tasksBySight: tasksBySight,
|
|
110
|
+
});
|
|
111
|
+
var handleOpenGallery = function () {
|
|
112
|
+
setCurrentScreen(PhotoCaptureScreen.GALLERY);
|
|
113
|
+
analytics.trackEvent('Gallery Opened');
|
|
114
|
+
};
|
|
115
|
+
var handleGalleryBack = function () { return setCurrentScreen(PhotoCaptureScreen.CAMERA); };
|
|
116
|
+
var handleNavigateToCapture = function (options) {
|
|
117
|
+
if (options.reason === common_ui_web_1.NavigateToCaptureReason.ADD_DAMAGE) {
|
|
118
|
+
addDamageHandle.handleAddDamage();
|
|
119
|
+
}
|
|
120
|
+
else if (options.reason === common_ui_web_1.NavigateToCaptureReason.CAPTURE_SIGHT) {
|
|
121
|
+
var selectedSight = sights.find(function (sight) { return sight.id === options.sightId; });
|
|
122
|
+
if (!selectedSight) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
sightState.selectSight(selectedSight);
|
|
126
|
+
}
|
|
127
|
+
else if (options.reason === common_ui_web_1.NavigateToCaptureReason.RETAKE_PICTURE) {
|
|
128
|
+
sightState.retakeSight(options.sightId);
|
|
129
|
+
}
|
|
130
|
+
setCurrentScreen(PhotoCaptureScreen.CAMERA);
|
|
131
|
+
};
|
|
132
|
+
var allowRedirect = (0, common_1.usePreventExit)(sightState.sightsTaken.length !== 0).allowRedirect;
|
|
133
|
+
var handleGalleryValidate = function () {
|
|
134
|
+
startTasks()
|
|
135
|
+
.then(function () {
|
|
136
|
+
analytics.trackEvent('Capture Completed');
|
|
137
|
+
analytics.setUserProperties({
|
|
138
|
+
captureCompleted: true,
|
|
139
|
+
sightSelected: 'inspection-completed',
|
|
140
|
+
});
|
|
141
|
+
allowRedirect();
|
|
142
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete();
|
|
143
|
+
})
|
|
144
|
+
.catch(function (err) {
|
|
145
|
+
loading.onError(err);
|
|
146
|
+
monitoring.handleError(err);
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
var isViolatingEnforcedOrientation = enforceOrientation &&
|
|
150
|
+
(enforceOrientation === types_1.DeviceOrientation.PORTRAIT) !== dimensions.isPortrait;
|
|
151
|
+
var hudProps = {
|
|
152
|
+
sights: sights,
|
|
153
|
+
selectedSight: sightState.selectedSight,
|
|
154
|
+
sightsTaken: sightState.sightsTaken,
|
|
155
|
+
lastPictureTakenUri: sightState.lastPictureTakenUri,
|
|
156
|
+
mode: addDamageHandle.mode,
|
|
157
|
+
onOpenGallery: handleOpenGallery,
|
|
158
|
+
onSelectSight: sightState.selectSight,
|
|
159
|
+
onRetakeSight: sightState.retakeSight,
|
|
160
|
+
onAddDamage: addDamageHandle.handleAddDamage,
|
|
161
|
+
onCancelAddDamage: addDamageHandle.handleCancelAddDamage,
|
|
162
|
+
onRetry: sightState.retryLoadingInspection,
|
|
163
|
+
loading: loading,
|
|
164
|
+
onClose: onClose,
|
|
165
|
+
inspectionId: inspectionId,
|
|
166
|
+
showCloseButton: showCloseButton,
|
|
167
|
+
images: images,
|
|
168
|
+
enableAddDamage: enableAddDamage,
|
|
169
|
+
sightGuidelines: sightGuidelines,
|
|
170
|
+
enableSightGuidelines: enableSightGuidelines,
|
|
171
|
+
currentTutorialStep: currentTutorialStep,
|
|
172
|
+
onNextTutorialStep: goToNextTutorialStep,
|
|
173
|
+
onCloseTutorial: closeTutorial,
|
|
174
|
+
allowSkipTutorial: allowSkipTutorial,
|
|
175
|
+
};
|
|
176
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: PhotoCapture_styles_1.styles['container'] }, { children: [currentScreen === PhotoCaptureScreen.CAMERA && isViolatingEnforcedOrientation && ((0, jsx_runtime_1.jsxs)("div", __assign({ style: PhotoCapture_styles_1.styles['orientationErrorContainer'] }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ style: PhotoCapture_styles_1.styles['orientationErrorTitleContainer'] }, { children: [(0, jsx_runtime_1.jsx)(common_ui_web_1.Icon, { icon: 'rotate', primaryColor: 'text-primary', size: 30 }), (0, jsx_runtime_1.jsx)("div", __assign({ style: PhotoCapture_styles_1.styles['orientationErrorTitle'] }, { children: t('photo.orientationError.title') }))] })), (0, jsx_runtime_1.jsx)("div", __assign({ style: PhotoCapture_styles_1.styles['orientationErrorDescription'] }, { children: t('photo.orientationError.description') }))] }))), currentScreen === PhotoCaptureScreen.CAMERA && !isViolatingEnforcedOrientation && ((0, jsx_runtime_1.jsx)(camera_web_1.Camera, __assign({ HUDComponent: PhotoCaptureHUD_1.PhotoCaptureHUD, onPictureTaken: handlePictureTaken, hudProps: hudProps }, adaptiveCameraConfig))), currentScreen === PhotoCaptureScreen.GALLERY && ((0, jsx_runtime_1.jsx)(common_ui_web_1.InspectionGallery, __assign({ inspectionId: inspectionId, apiConfig: apiConfig, captureMode: true, lang: lang, showBackButton: true, sights: sights, allowSkipRetake: allowSkipRetake, onBack: handleGalleryBack, onNavigateToCapture: handleNavigateToCapture, onValidate: handleGalleryValidate, enableAddDamage: enableAddDamage, validateButtonLabel: validateButtonLabel }, complianceOptions))), (0, jsx_runtime_1.jsx)(common_ui_web_1.BackdropDialog, { show: isBadConnectionWarningDialogDisplayed, showCancelButton: false, dialogIcon: 'warning-outline', dialogIconPrimaryColor: 'caution-base', message: t('photo.badConnectionWarning.message'), confirmLabel: t('photo.badConnectionWarning.confirm'), onConfirm: closeBadConnectionWarningDialog })] })));
|
|
177
|
+
}
|
|
178
|
+
exports.PhotoCapture = PhotoCapture;
|
|
179
|
+
//# sourceMappingURL=PhotoCapture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhotoCapture.js","sourceRoot":"","sources":["../../src/PhotoCapture/PhotoCapture.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqD;AACrD,qDAA6E;AAC7E,6CAM4B;AAC5B,2DAMmC;AACnC,qDAAuD;AAEvD,2CAQ2B;AAC3B,+BAAiC;AACjC,+CAA+C;AAC/C,6DAA+C;AAC/C,qDAA0E;AAC1E,iCAYiB;AA+DjB,IAAK,kBAGJ;AAHD,WAAK,kBAAkB;IACrB,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACrB,CAAC,EAHI,kBAAkB,KAAlB,kBAAkB,QAGtB;AAED,2EAA2E;AAC3E,SAAgB,YAA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AkB,EAClC,QAAQ,EAAE,QAAQ,IACd,oBAAoB,EACxB,CACH,EACA,aAAa,KAAK,kBAAkB,CAAC,OAAO,IAAI,CAC/C,uBAAC,iCAAiB,aAChB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,IAAI,EACjB,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,IAAI,EACpB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,iBAAiB,EACzB,mBAAmB,EAAE,uBAAuB,EAC5C,UAAU,EAAE,qBAAqB,EACjC,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,mBAAmB,IACpC,iBAAiB,EACrB,CACH,EACD,uBAAC,8BAAc,IACb,IAAI,EAAE,qCAAqC,EAC3C,gBAAgB,EAAE,KAAK,EACvB,UAAU,EAAC,iBAAiB,EAC5B,sBAAsB,EAAC,cAAc,EACrC,OAAO,EAAE,CAAC,CAAC,oCAAoC,CAAC,EAChD,YAAY,EAAE,CAAC,CAAC,oCAAoC,CAAC,EACrD,SAAS,EAAE,+BAA+B,GAC1C,KACE,CACP,CAAC;AACJ,CAAC;AAvND,oCAuNC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.styles = void 0;
|
|
4
|
+
exports.styles = {
|
|
5
|
+
container: {
|
|
6
|
+
height: '100%',
|
|
7
|
+
width: '100%',
|
|
8
|
+
},
|
|
9
|
+
orientationErrorContainer: {
|
|
10
|
+
height: '100%',
|
|
11
|
+
width: '100%',
|
|
12
|
+
display: 'flex',
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
boxSizing: 'border-box',
|
|
17
|
+
padding: '50px 10%',
|
|
18
|
+
},
|
|
19
|
+
orientationErrorTitleContainer: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
},
|
|
23
|
+
orientationErrorTitle: {
|
|
24
|
+
fontSize: 18,
|
|
25
|
+
marginLeft: 16,
|
|
26
|
+
},
|
|
27
|
+
orientationErrorDescription: {
|
|
28
|
+
fontSize: 16,
|
|
29
|
+
paddingTop: 16,
|
|
30
|
+
opacity: 0.8,
|
|
31
|
+
textAlign: 'center',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=PhotoCapture.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhotoCapture.styles.js","sourceRoot":"","sources":["../../src/PhotoCapture/PhotoCapture.styles.ts"],"names":[],"mappings":";;;AAEa,QAAA,MAAM,GAAW;IAC5B,SAAS,EAAE;QACT,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd;IACD,yBAAyB,EAAE;QACzB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,QAAQ;QACvB,SAAS,EAAE,YAAY;QACvB,OAAO,EAAE,UAAU;KACpB;IACD,8BAA8B,EAAE;QAC9B,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;KACrB;IACD,qBAAqB,EAAE;QACrB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;KACf;IACD,2BAA2B,EAAE;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,OAAO,EAAE,GAAG;QACZ,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PhotoCaptureProps } from './PhotoCapture';
|
|
2
|
+
/**
|
|
3
|
+
* The PhotoCapture component is a ready-to-use, single page component that implements a Camera app and lets the user
|
|
4
|
+
* take pictures of their vehicle in order to add them to an already created Monk inspection. In order to use this
|
|
5
|
+
* component, you first need to generate an Auth0 authentication token, and create an inspection using the Monk Api.
|
|
6
|
+
* When creating the inspection, don't forget to set the tasks statuses to `NOT_STARTED`. This component will handle the
|
|
7
|
+
* starting of the tasks at the end of the capturing process. You can then pass the inspection ID, the api config (with
|
|
8
|
+
* the auth token), as well as the list of sights to be taken by the user to this component, and everything will be
|
|
9
|
+
* handled automatically for you.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { sights } from '@monkvision/sights';
|
|
13
|
+
* import { PhotoCapture } from '@monkvision/inspection-capture-web';
|
|
14
|
+
*
|
|
15
|
+
* const PHOTO_CAPTURE_SIGHTS = [
|
|
16
|
+
* sights['fesc20-0mJeXBDf'],
|
|
17
|
+
* sights['fesc20-26n47kaO'],
|
|
18
|
+
* sights['fesc20-2bLRuhEQ'],
|
|
19
|
+
* sights['fesc20-4Wqx52oU'],
|
|
20
|
+
* sights['fesc20-Tlu3sz8A'],
|
|
21
|
+
* sights['fesc20-5Ts1UkPT'],
|
|
22
|
+
* sights['fesc20-raHPDUNm'],
|
|
23
|
+
* ];
|
|
24
|
+
*
|
|
25
|
+
* export function PhotoCaptureScreen({ inspectionId, apiConfig }: PhotoCaptureScreenProps) {
|
|
26
|
+
* const { i18n } = useTranslation();
|
|
27
|
+
*
|
|
28
|
+
* return (
|
|
29
|
+
* <PhotoCapture
|
|
30
|
+
* inspectionId={inspectionId}
|
|
31
|
+
* apiConfig={apiConfig}
|
|
32
|
+
* sights={PHOTO_CAPTURE_SIGHTS}
|
|
33
|
+
* compliances={{ iqa: true }}
|
|
34
|
+
* onComplete={() => { / * Navigate to another page * / }}
|
|
35
|
+
* lang={i18n.language}
|
|
36
|
+
* />
|
|
37
|
+
* );
|
|
38
|
+
* }
|
|
39
|
+
*/
|
|
40
|
+
export declare const PhotoCaptureHOC: import("react").ForwardRefExoticComponent<PhotoCaptureProps & import("react").RefAttributes<unknown>>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.PhotoCaptureHOC = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var common_1 = require("@monkvision/common");
|
|
17
|
+
var i18n_1 = require("../i18n");
|
|
18
|
+
var PhotoCapture_1 = require("./PhotoCapture");
|
|
19
|
+
/**
|
|
20
|
+
* The PhotoCapture component is a ready-to-use, single page component that implements a Camera app and lets the user
|
|
21
|
+
* take pictures of their vehicle in order to add them to an already created Monk inspection. In order to use this
|
|
22
|
+
* component, you first need to generate an Auth0 authentication token, and create an inspection using the Monk Api.
|
|
23
|
+
* When creating the inspection, don't forget to set the tasks statuses to `NOT_STARTED`. This component will handle the
|
|
24
|
+
* starting of the tasks at the end of the capturing process. You can then pass the inspection ID, the api config (with
|
|
25
|
+
* the auth token), as well as the list of sights to be taken by the user to this component, and everything will be
|
|
26
|
+
* handled automatically for you.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* import { sights } from '@monkvision/sights';
|
|
30
|
+
* import { PhotoCapture } from '@monkvision/inspection-capture-web';
|
|
31
|
+
*
|
|
32
|
+
* const PHOTO_CAPTURE_SIGHTS = [
|
|
33
|
+
* sights['fesc20-0mJeXBDf'],
|
|
34
|
+
* sights['fesc20-26n47kaO'],
|
|
35
|
+
* sights['fesc20-2bLRuhEQ'],
|
|
36
|
+
* sights['fesc20-4Wqx52oU'],
|
|
37
|
+
* sights['fesc20-Tlu3sz8A'],
|
|
38
|
+
* sights['fesc20-5Ts1UkPT'],
|
|
39
|
+
* sights['fesc20-raHPDUNm'],
|
|
40
|
+
* ];
|
|
41
|
+
*
|
|
42
|
+
* export function PhotoCaptureScreen({ inspectionId, apiConfig }: PhotoCaptureScreenProps) {
|
|
43
|
+
* const { i18n } = useTranslation();
|
|
44
|
+
*
|
|
45
|
+
* return (
|
|
46
|
+
* <PhotoCapture
|
|
47
|
+
* inspectionId={inspectionId}
|
|
48
|
+
* apiConfig={apiConfig}
|
|
49
|
+
* sights={PHOTO_CAPTURE_SIGHTS}
|
|
50
|
+
* compliances={{ iqa: true }}
|
|
51
|
+
* onComplete={() => { / * Navigate to another page * / }}
|
|
52
|
+
* lang={i18n.language}
|
|
53
|
+
* />
|
|
54
|
+
* );
|
|
55
|
+
* }
|
|
56
|
+
*/
|
|
57
|
+
exports.PhotoCaptureHOC = (0, common_1.i18nWrap)(function (props) {
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(common_1.MonkProvider, { children: (0, jsx_runtime_1.jsx)(PhotoCapture_1.PhotoCapture, __assign({}, props)) }));
|
|
59
|
+
}, i18n_1.i18nInspectionCaptureWeb);
|
|
60
|
+
//# sourceMappingURL=PhotoCaptureHOC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhotoCaptureHOC.js","sourceRoot":"","sources":["../../src/PhotoCapture/PhotoCaptureHOC.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4D;AAC5D,gCAAmD;AACnD,+CAAiE;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACU,QAAA,eAAe,GAAG,IAAA,iBAAQ,EAAC,UAAC,KAAwB;IAC/D,OAAO,CACL,uBAAC,qBAAY,cACX,uBAAC,2BAAY,eAAK,KAAK,EAAI,GACd,CAChB,CAAC;AACJ,CAAC,EAAE,+BAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { CaptureAppConfig, Image, Sight } from '@monkvision/types';
|
|
2
|
+
import { CameraHUDProps } from '@monkvision/camera-web';
|
|
3
|
+
import { LoadingState } from '@monkvision/common';
|
|
4
|
+
import { PhotoCaptureMode, TutorialSteps } from '../hooks';
|
|
5
|
+
/**
|
|
6
|
+
* Props of the PhotoCaptureHUD component.
|
|
7
|
+
*/
|
|
8
|
+
export interface PhotoCaptureHUDProps extends CameraHUDProps, Pick<CaptureAppConfig, 'enableSightGuidelines' | 'sightGuidelines' | 'enableAddDamage' | 'showCloseButton' | 'allowSkipTutorial'> {
|
|
9
|
+
/**
|
|
10
|
+
* The inspection ID.
|
|
11
|
+
*/
|
|
12
|
+
inspectionId: string;
|
|
13
|
+
/**
|
|
14
|
+
* The list of sights provided to the PhotoCapture component.
|
|
15
|
+
*/
|
|
16
|
+
sights: Sight[];
|
|
17
|
+
/**
|
|
18
|
+
* The currently selected sight in the PhotoCapture component : the sight that the user needs to capture.
|
|
19
|
+
*/
|
|
20
|
+
selectedSight: Sight;
|
|
21
|
+
/**
|
|
22
|
+
* Array containing the list of sights that the user has already captured.
|
|
23
|
+
*/
|
|
24
|
+
sightsTaken: Sight[];
|
|
25
|
+
/**
|
|
26
|
+
* Value storing the last picture taken by the user. If no picture has been taken yet, this value is null.
|
|
27
|
+
*/
|
|
28
|
+
lastPictureTakenUri: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* The current mode of the component.
|
|
31
|
+
*/
|
|
32
|
+
mode: PhotoCaptureMode;
|
|
33
|
+
/**
|
|
34
|
+
* Global loading state of the PhotoCapture component.
|
|
35
|
+
*/
|
|
36
|
+
loading: LoadingState;
|
|
37
|
+
/**
|
|
38
|
+
* The current tutorial step in PhotoCapture component.
|
|
39
|
+
*/
|
|
40
|
+
currentTutorialStep: TutorialSteps | null;
|
|
41
|
+
/**
|
|
42
|
+
* Callback called when the user clicks on "Next" button in PhotoCapture tutorial.
|
|
43
|
+
*/
|
|
44
|
+
onNextTutorialStep: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Callback called when the user clicks on "Close" button in PhotoCapture tutorial.
|
|
47
|
+
*/
|
|
48
|
+
onCloseTutorial: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Callback called when the user manually select a new sight.
|
|
51
|
+
*/
|
|
52
|
+
onSelectSight: (sight: Sight) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Callback called when the user manually select a sight to retake.
|
|
55
|
+
*/
|
|
56
|
+
onRetakeSight: (sight: string) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Callback to be called when the user clicks on the "Add Damage" button.
|
|
59
|
+
*/
|
|
60
|
+
onAddDamage: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Callback to be called when the user clicks on the "Cancel" button of the Add Damage mode.
|
|
63
|
+
*/
|
|
64
|
+
onCancelAddDamage: () => void;
|
|
65
|
+
/**
|
|
66
|
+
* Callback that can be used to retry fetching this state object from the API in case the previous fetch failed.
|
|
67
|
+
*/
|
|
68
|
+
onRetry: () => void;
|
|
69
|
+
/**
|
|
70
|
+
* Callback called when the user clicks on the gallery icon.
|
|
71
|
+
*/
|
|
72
|
+
onOpenGallery: () => void;
|
|
73
|
+
/**
|
|
74
|
+
* Callback called when the user clicks on the close button. If this callback is not provided, the close button is not
|
|
75
|
+
* displayed.
|
|
76
|
+
*/
|
|
77
|
+
onClose?: () => void;
|
|
78
|
+
/**
|
|
79
|
+
* The current images taken by the user (ignoring retaken pictures etc.).
|
|
80
|
+
*/
|
|
81
|
+
images: Image[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* This component implements the Camera HUD (head-up display) displayed in the PhotoCapture component over the Camera
|
|
85
|
+
* preview. It implements elements such as buttons to interact with the camera, PhotoCapture indicators, error messages,
|
|
86
|
+
* loaders etc.
|
|
87
|
+
*/
|
|
88
|
+
export declare function PhotoCaptureHUD({ inspectionId, sights, selectedSight, sightsTaken, lastPictureTakenUri, mode, onSelectSight, onRetakeSight, onAddDamage, onCancelAddDamage, onOpenGallery, onRetry, onClose, showCloseButton, loading, handle, cameraPreview, images, enableAddDamage, sightGuidelines, enableSightGuidelines, currentTutorialStep, allowSkipTutorial, onNextTutorialStep, onCloseTutorial, }: PhotoCaptureHUDProps): JSX.Element;
|