@monkvision/inspection-capture-web 4.5.6 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/README.md +134 -19
  2. package/lib/DamageDisclosure/DamageDisclosure.d.ts +44 -0
  3. package/lib/DamageDisclosure/DamageDisclosure.js +114 -0
  4. package/lib/DamageDisclosure/DamageDisclosure.styles.js +33 -0
  5. package/lib/DamageDisclosure/DamageDisclosureHOC.d.ts +27 -0
  6. package/lib/DamageDisclosure/DamageDisclosureHOC.js +45 -0
  7. package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.d.ts +73 -0
  8. package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.js +49 -0
  9. package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.styles.js +24 -0
  10. package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUDElements/DamageDisclosureHUDElements.d.ts +52 -0
  11. package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUDElements/DamageDisclosureHUDElements.js +22 -0
  12. package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUDElements/index.d.ts +1 -0
  13. package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUDElements/index.js +5 -0
  14. package/lib/DamageDisclosure/DamageDisclosureHUD/index.d.ts +2 -0
  15. package/lib/DamageDisclosure/DamageDisclosureHUD/index.js +20 -0
  16. package/lib/DamageDisclosure/hooks/index.d.ts +1 -0
  17. package/lib/DamageDisclosure/hooks/index.js +17 -0
  18. package/lib/DamageDisclosure/hooks/useDamageDisclosureState.d.ts +30 -0
  19. package/lib/DamageDisclosure/hooks/useDamageDisclosureState.js +55 -0
  20. package/lib/DamageDisclosure/index.d.ts +3 -0
  21. package/lib/DamageDisclosure/index.js +20 -0
  22. package/lib/PhotoCapture/PhotoCapture.d.ts +7 -5
  23. package/lib/PhotoCapture/PhotoCapture.js +27 -21
  24. package/lib/PhotoCapture/PhotoCapture.styles.js +0 -24
  25. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.d.ts +24 -7
  26. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.js +4 -4
  27. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/PhotoCaptureHUDElements.d.ts +21 -4
  28. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/PhotoCaptureHUDElements.js +10 -8
  29. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/AddDamageButton.d.ts +3 -4
  30. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/AddDamageButton.js +5 -4
  31. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.d.ts +1 -1
  32. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.js +4 -3
  33. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.d.ts +3 -3
  34. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.js +5 -4
  35. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.styles.js +2 -2
  36. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSlider.styles.js +2 -2
  37. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/hooks.d.ts +2 -2
  38. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.d.ts +3 -3
  39. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.js +4 -4
  40. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.styles.js +3 -3
  41. package/lib/PhotoCapture/PhotoCaptureHUD/hooks/index.d.ts +0 -1
  42. package/lib/PhotoCapture/PhotoCaptureHUD/hooks/index.js +0 -1
  43. package/lib/PhotoCapture/PhotoCaptureHUD/index.d.ts +0 -6
  44. package/lib/PhotoCapture/PhotoCaptureHUD/index.js +0 -6
  45. package/lib/PhotoCapture/hooks/index.d.ts +0 -8
  46. package/lib/PhotoCapture/hooks/index.js +0 -8
  47. package/lib/PhotoCapture/hooks/usePhotoCaptureSightState.d.ts +3 -0
  48. package/lib/PhotoCapture/hooks/usePhotoCaptureSightState.js +1 -1
  49. package/lib/PhotoCapture/hooks/usePhotoCaptureTutorial.d.ts +2 -2
  50. package/lib/VideoCapture/VideoCapture.d.ts +28 -0
  51. package/lib/VideoCapture/VideoCapture.js +81 -0
  52. package/lib/VideoCapture/VideoCapture.styles.js +9 -0
  53. package/lib/VideoCapture/VideoCaptureHOC.d.ts +27 -0
  54. package/lib/VideoCapture/VideoCaptureHOC.js +45 -0
  55. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureHUD.d.ts +44 -0
  56. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureHUD.js +158 -0
  57. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureHUD.styles.js +14 -0
  58. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.d.ts +6 -0
  59. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.js +38 -0
  60. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.types.d.ts +33 -0
  61. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.types.js +2 -0
  62. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecordingStyles.d.ts +4873 -0
  63. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecordingStyles.js +105 -0
  64. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/index.d.ts +2 -0
  65. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/index.js +5 -0
  66. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/VideoCaptureTutorial.d.ts +14 -0
  67. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/VideoCaptureTutorial.js +30 -0
  68. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/index.d.ts +1 -0
  69. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/index.js +5 -0
  70. package/lib/VideoCapture/VideoCaptureHUD/index.d.ts +1 -0
  71. package/lib/VideoCapture/VideoCaptureHUD/index.js +5 -0
  72. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.d.ts +23 -0
  73. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.js +26 -0
  74. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.styles.d.ts +12 -0
  75. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.styles.js +72 -0
  76. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/index.d.ts +1 -0
  77. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/index.js +5 -0
  78. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.d.ts +7 -0
  79. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.js +32 -0
  80. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.styles.d.ts +12 -0
  81. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.styles.js +87 -0
  82. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.types.d.ts +22 -0
  83. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.types.js +2 -0
  84. package/lib/VideoCapture/VideoCapturePageLayout/index.d.ts +3 -0
  85. package/lib/VideoCapture/VideoCapturePageLayout/index.js +7 -0
  86. package/lib/VideoCapture/VideoCapturePermissions/VideoCapturePermissions.d.ts +19 -0
  87. package/lib/VideoCapture/VideoCapturePermissions/VideoCapturePermissions.js +107 -0
  88. package/lib/VideoCapture/VideoCapturePermissions/index.d.ts +1 -0
  89. package/lib/VideoCapture/VideoCapturePermissions/index.js +5 -0
  90. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.d.ts +7 -0
  91. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.js +44 -0
  92. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.styles.d.ts +2437 -0
  93. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.styles.js +60 -0
  94. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.types.d.ts +34 -0
  95. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.types.js +2 -0
  96. package/lib/VideoCapture/VideoCaptureProcessing/index.d.ts +2 -0
  97. package/lib/VideoCapture/VideoCaptureProcessing/index.js +5 -0
  98. package/lib/VideoCapture/hooks/index.d.ts +5 -0
  99. package/lib/VideoCapture/hooks/index.js +21 -0
  100. package/lib/VideoCapture/hooks/useFastMovementsDetection/fastMovementsDetection.d.ts +18 -0
  101. package/lib/VideoCapture/hooks/useFastMovementsDetection/fastMovementsDetection.js +45 -0
  102. package/lib/VideoCapture/hooks/useFastMovementsDetection/index.d.ts +2 -0
  103. package/lib/VideoCapture/hooks/useFastMovementsDetection/index.js +20 -0
  104. package/lib/VideoCapture/hooks/useFastMovementsDetection/useFastMovementsDetection.d.ts +34 -0
  105. package/lib/VideoCapture/hooks/useFastMovementsDetection/useFastMovementsDetection.js +64 -0
  106. package/lib/VideoCapture/hooks/useFrameSelection/index.d.ts +1 -0
  107. package/lib/VideoCapture/hooks/useFrameSelection/index.js +17 -0
  108. package/lib/VideoCapture/hooks/useFrameSelection/laplaceScores.d.ts +16 -0
  109. package/lib/VideoCapture/hooks/useFrameSelection/laplaceScores.js +62 -0
  110. package/lib/VideoCapture/hooks/useFrameSelection/useFrameSelection.d.ts +43 -0
  111. package/lib/VideoCapture/hooks/useFrameSelection/useFrameSelection.js +50 -0
  112. package/lib/VideoCapture/hooks/useVehicleWalkaround.d.ts +26 -0
  113. package/lib/VideoCapture/hooks/useVehicleWalkaround.js +39 -0
  114. package/lib/VideoCapture/hooks/useVideoRecording.d.ts +97 -0
  115. package/lib/VideoCapture/hooks/useVideoRecording.js +140 -0
  116. package/lib/VideoCapture/hooks/useVideoUploadQueue.d.ts +40 -0
  117. package/lib/VideoCapture/hooks/useVideoUploadQueue.js +51 -0
  118. package/lib/VideoCapture/index.d.ts +2 -0
  119. package/lib/VideoCapture/index.js +5 -0
  120. package/lib/assets/logos.asset.d.ts +1 -0
  121. package/lib/assets/logos.asset.js +4 -0
  122. package/lib/components/CancelButton/CancelButton.d.ts +14 -0
  123. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/PhotoCaptureHUDCancelButton.js → components/CancelButton/CancelButton.js} +6 -6
  124. package/lib/components/CancelButton/index.d.ts +1 -0
  125. package/lib/components/CancelButton/index.js +5 -0
  126. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.d.ts → components/CloseUpShot/CloseUpShot.d.ts} +10 -4
  127. package/lib/components/CloseUpShot/CloseUpShot.js +34 -0
  128. package/lib/components/CloseUpShot/CloseUpShot.styles.d.ts +2 -0
  129. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.styles.js → components/CloseUpShot/CloseUpShot.styles.js} +4 -3
  130. package/lib/components/CloseUpShot/hooks.d.ts +7 -0
  131. package/lib/components/CloseUpShot/hooks.js +25 -0
  132. package/lib/components/CloseUpShot/index.d.ts +1 -0
  133. package/lib/components/CloseUpShot/index.js +5 -0
  134. package/lib/components/Counter/Counter.d.ts +6 -0
  135. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.js → components/Counter/Counter.js} +9 -9
  136. package/lib/components/Counter/Counter.styles.d.ts +2 -0
  137. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter → components/Counter}/hooks.d.ts +6 -6
  138. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter → components/Counter}/hooks.js +6 -6
  139. package/lib/components/Counter/index.d.ts +2 -0
  140. package/lib/components/Counter/index.js +5 -0
  141. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.d.ts → components/HUDButtons/HUDButtons.d.ts} +4 -4
  142. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.js → components/HUDButtons/HUDButtons.js} +5 -5
  143. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons → components/HUDButtons}/hooks.d.ts +3 -3
  144. package/lib/components/HUDButtons/hooks.js +44 -0
  145. package/lib/components/HUDButtons/index.d.ts +1 -0
  146. package/lib/components/HUDButtons/index.js +5 -0
  147. package/lib/components/HUDOverlay/HUDOverlay.d.ts +7 -0
  148. package/lib/components/HUDOverlay/HUDOverlay.js +36 -0
  149. package/lib/components/HUDOverlay/HUDOverlay.styles.d.ts +2 -0
  150. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay → components/HUDOverlay}/hooks.d.ts +4 -4
  151. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay → components/HUDOverlay}/hooks.js +3 -3
  152. package/lib/components/HUDOverlay/index.d.ts +2 -0
  153. package/lib/components/HUDOverlay/index.js +5 -0
  154. package/lib/components/OrientationEnforcer/OrientationEnforcer.d.ts +16 -0
  155. package/lib/components/OrientationEnforcer/OrientationEnforcer.js +34 -0
  156. package/lib/components/OrientationEnforcer/OrientationEnforcer.styles.d.ts +815 -0
  157. package/lib/components/OrientationEnforcer/OrientationEnforcer.styles.js +49 -0
  158. package/lib/components/OrientationEnforcer/index.d.ts +1 -0
  159. package/lib/components/OrientationEnforcer/index.js +5 -0
  160. package/lib/components/PartSelection/PartSelection.d.ts +40 -0
  161. package/lib/components/PartSelection/PartSelection.js +39 -0
  162. package/lib/components/PartSelection/PartSelection.styles.d.ts +2 -0
  163. package/lib/components/PartSelection/PartSelection.styles.js +54 -0
  164. package/lib/components/PartSelection/index.d.ts +2 -0
  165. package/lib/components/PartSelection/index.js +5 -0
  166. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.d.ts → components/ZoomOutShot/ZoomOutShot.d.ts} +3 -3
  167. package/lib/components/ZoomOutShot/ZoomOutShot.js +38 -0
  168. package/lib/components/ZoomOutShot/ZoomOutShot.styles.d.ts +2 -0
  169. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.styles.js → components/ZoomOutShot/ZoomOutShot.styles.js} +3 -3
  170. package/lib/components/ZoomOutShot/hooks.d.ts +6 -0
  171. package/lib/components/ZoomOutShot/hooks.js +24 -0
  172. package/lib/components/ZoomOutShot/index.d.ts +1 -0
  173. package/lib/components/ZoomOutShot/index.js +5 -0
  174. package/lib/components/index.d.ts +8 -0
  175. package/lib/components/index.js +24 -0
  176. package/lib/errors.d.ts +3 -0
  177. package/lib/errors.js +7 -0
  178. package/lib/hooks/index.d.ts +10 -0
  179. package/lib/hooks/index.js +26 -0
  180. package/lib/{PhotoCapture/hooks → hooks}/useAdaptiveCameraConfig.d.ts +2 -2
  181. package/lib/hooks/useAddDamageMode.d.ts +56 -0
  182. package/lib/hooks/useAddDamageMode.js +76 -0
  183. package/lib/{PhotoCapture/hooks → hooks}/useBadConnectionWarning.d.ts +2 -2
  184. package/lib/hooks/useColorBackground.d.ts +4 -0
  185. package/lib/hooks/useColorBackground.js +15 -0
  186. package/lib/hooks/useEnforceOrientation.d.ts +6 -0
  187. package/lib/hooks/useEnforceOrientation.js +14 -0
  188. package/lib/{PhotoCapture/hooks → hooks}/usePhotoCaptureImages.js +1 -1
  189. package/lib/{PhotoCapture/hooks → hooks}/usePictureTaken.d.ts +4 -4
  190. package/lib/hooks/usePictureTaken.js +58 -0
  191. package/lib/{PhotoCapture/hooks → hooks}/useStartTasksOnComplete.d.ts +6 -6
  192. package/lib/{PhotoCapture/hooks → hooks}/useStartTasksOnComplete.js +3 -1
  193. package/lib/{PhotoCapture/hooks → hooks}/useUploadQueue.d.ts +24 -7
  194. package/lib/{PhotoCapture/hooks → hooks}/useUploadQueue.js +14 -4
  195. package/lib/index.d.ts +2 -0
  196. package/lib/index.js +2 -0
  197. package/lib/translations/de.json +64 -5
  198. package/lib/translations/en.json +64 -5
  199. package/lib/translations/fr.json +64 -5
  200. package/lib/translations/nl.json +64 -5
  201. package/lib/types.d.ts +102 -0
  202. package/lib/types.js +43 -0
  203. package/package.json +15 -15
  204. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/hooks.js +0 -44
  205. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/index.d.ts +0 -1
  206. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/index.js +0 -5
  207. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/PhotoCaptureHUDCancelButton.d.ts +0 -14
  208. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/index.d.ts +0 -1
  209. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/index.js +0 -5
  210. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.d.ts +0 -6
  211. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/index.d.ts +0 -2
  212. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/index.js +0 -5
  213. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.js +0 -38
  214. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/hooks.d.ts +0 -6
  215. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/hooks.js +0 -24
  216. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/index.d.ts +0 -1
  217. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/index.js +0 -5
  218. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.js +0 -40
  219. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/hooks.d.ts +0 -7
  220. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/hooks.js +0 -25
  221. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/index.d.ts +0 -1
  222. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/index.js +0 -5
  223. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.d.ts +0 -7
  224. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.js +0 -36
  225. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/index.d.ts +0 -2
  226. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/index.js +0 -5
  227. package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDButtonBackground.d.ts +0 -4
  228. package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDButtonBackground.js +0 -13
  229. package/lib/PhotoCapture/hooks/useAddDamageMode.d.ts +0 -42
  230. package/lib/PhotoCapture/hooks/useAddDamageMode.js +0 -57
  231. package/lib/PhotoCapture/hooks/usePictureTaken.js +0 -46
  232. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.styles.d.ts → DamageDisclosure/DamageDisclosure.styles.d.ts} +0 -0
  233. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.styles.d.ts → DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.styles.d.ts} +0 -0
  234. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.styles.d.ts → VideoCapture/VideoCapture.styles.d.ts} +0 -0
  235. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.styles.d.ts → VideoCapture/VideoCaptureHUD/VideoCaptureHUD.styles.d.ts} +0 -0
  236. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.styles.js → components/Counter/Counter.styles.js} +0 -0
  237. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.styles.d.ts → components/HUDButtons/HUDButtons.styles.d.ts} +0 -0
  238. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.styles.js → components/HUDButtons/HUDButtons.styles.js} +0 -0
  239. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.styles.js → components/HUDOverlay/HUDOverlay.styles.js} +0 -0
  240. /package/lib/{PhotoCapture/hooks → hooks}/useAdaptiveCameraConfig.js +0 -0
  241. /package/lib/{PhotoCapture/hooks → hooks}/useBadConnectionWarning.js +0 -0
  242. /package/lib/{PhotoCapture/hooks → hooks}/usePhotoCaptureImages.d.ts +0 -0
  243. /package/lib/{PhotoCapture/hooks → hooks}/useTracking.d.ts +0 -0
  244. /package/lib/{PhotoCapture/hooks → hooks}/useTracking.js +0 -0
package/README.md CHANGED
@@ -5,6 +5,9 @@ There are two main workflows for capturing pictures of a vehicle for a Monk insp
5
5
  to take pictures of the vehicle by aligning the vehicle with the Sight overlays.
6
6
  - The **VideoCapture** workflow : the user is asked to record a quick video of their vehicle by filming it and rotating
7
7
  in a full circle around it.
8
+ - The **DamageDisclosure** workflow : The user is guided to capture close-up pictures of specific damaged parts of the vehicle. There are 2 workflows available:
9
+ - Part-selection: Before taking the picture, the user must first select the damaged part on the vehicle wireframe then a close-up picture of the damage.
10
+ - Two-shot: The user is asked to take, first a wide picture of the vehicle, then a close-up picture of the damage.
8
11
 
9
12
  # Installing
10
13
  To install the package, you can run the following command :
@@ -17,7 +20,7 @@ If you are using TypeScript, this package comes with its type definitions integr
17
20
  anything else!
18
21
 
19
22
  # PhotoCapture
20
- The PhotoCapture wofklow is aimed at guiding users in taking pictures of their vehicle in order to add them to a Monk
23
+ The PhotoCapture workflow is aimed at guiding users in taking pictures of their vehicle in order to add them to a Monk
21
24
  inspection. The user is shown a set of car wireframes, which we call *Sights* and that are available in the
22
25
  `@monkvision/sights` package. These Sights act as guides, and the user is asked to take pictures of their vehicle by
23
26
  aligning it with the Sights.
@@ -62,25 +65,27 @@ export function MonkPhotoCapturePage({ authToken }) {
62
65
 
63
66
  | Prop | Type | Description | Required | Default Value |
64
67
  |------------------------------------|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------------------------------------------|
65
- | sights | Sight[] | The list of Sights to take pictures of. The values in this array should be retreived from the `@monkvision/sights` package. | ✔️ | |
68
+ | format | `CompressionFormat` | The output format of the compression. | | `CompressionFormat.JPEG` |
69
+ | quality | `number` | Value indicating image quality for the compression output. | | `0.6` |
70
+ | resolution | `CameraResolution` | Indicates the resolution of the pictures taken by the Camera. | | `CameraResolution.UHD_4K` |
71
+ | allowImageUpscaling | `boolean` | Allow images to be scaled up if the device does not support the specified resolution in the `resolution` prop. | | `false` |
72
+ | additionalTasks | `TaskName[]` | An optional list of additional tasks to run on every image of the inspection. | | |
73
+ | startTasksOnComplete | `<code>boolean &#124; 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` |
74
+ | enforceOrientation | `DeviceOrientation` | Use this prop to enforce a specific device orientation for the Camera screen. | | |
66
75
  | 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
76
  | 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
77
  | onComplete | `() => void` | Callback called when inspection capture is complete. | | |
70
- | onPictureTaken | `(picture: MonkPicture) => void` | Callback called when the user has taken a picture in the Capture process. | | |
71
78
  | lang | <code>string &#124; null</code> | The language to be used by this component. | | `'en'` |
72
- | enforceOrientation | `DeviceOrientation` | Use this prop to enforce a specific device orientation for the Camera screen. | | |
73
- | maxUploadDurationWarning | `number` | Max upload duration in milliseconds before showing a bad connection warning to the user. Use `-1` to never display the warning. | | `15000` |
74
- | useAdaptiveImageQuality | `boolean` | Boolean indicating if the image quality should be downgraded automatically in case of low connection. | | `true` |
75
- | showCloseButton | `boolean` | Indicates if the close button should be displayed in the HUD on top of the Camera preview. | | `false` |
76
- | startTasksOnComplete | `<code>boolean &#124; 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` |
77
- | additionalTasks | `TaskName[]` | An optional list of additional tasks to run on every Sight of the inspection. | | |
79
+ | sights | Sight[] | The list of Sights to take pictures of. The values in this array should be retreived from the `@monkvision/sights` package. | ✔️ | |
78
80
  | 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. | | |
79
- | format | `CompressionFormat` | The output format of the compression. | | `CompressionFormat.JPEG` |
80
- | quality | `number` | Value indicating image quality for the compression output. | | `0.6` |
81
- | resolution | `CameraResolution` | Indicates the resolution of the pictures taken by the Camera. | | `CameraResolution.UHD_4K` |
82
- | allowImageUpscaling | `boolean` | Allow images to be scaled up if the device does not support the specified resolution in the `resolution` prop. | | `false` |
81
+ | showCloseButton | `boolean` | Indicates if the close button should be displayed in the HUD on top of the Camera preview. | | `false` |
83
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
+ | addDamage | `AddDamage` | Options for Add Damage. If disabled, the `Add Damage` button will be hidden. | | `AddDamage.PART_SELECT` |
84
+ | sightGuidelines | `sightGuideline[]` | A collection of sight guidelines in different language with a list of sightIds associate to it. | | |
85
+ | enableSightGuideline | `boolean` | Boolean indicating whether the sight guideline feature is enabled. If disabled, the guideline text will be hidden. | | `true` |
86
+ | enableTutorial | `PhotoCaptureTutorialOption` | Options for displaying the photo capture tutorial. | | `PhotoCaptureTutorialOption.FIRST_TIME_ONLY` |
87
+ | allowSkipTutorial | `boolean` | Boolean indicating if the user can skip the PhotoCapture tutorial. | | `true` |
88
+ | enableSightTutorial | `boolean` | Boolean indicating whether the sight tutorial feature is enabled. | | `true` |
84
89
  | enableCompliance | `boolean` | Indicates if compliance checks should be enabled or not. | | `true` |
85
90
  | enableCompliancePerSight | `string[]` | Array of Sight IDs that indicates for which sight IDs the compliance should be enabled. | | |
86
91
  | complianceIssues | `ComplianceIssue[]` | If compliance checks are enabled, this property can be used to select a list of compliance issues to check. | | `DEFAULT_COMPLIANCE_ISSUES` |
@@ -88,11 +93,121 @@ export function MonkPhotoCapturePage({ authToken }) {
88
93
  | useLiveCompliance | `boolean` | Indicates if live compliance should be enabled or not. | | `false` |
89
94
  | customComplianceThresholds | `CustomComplianceThresholds` | Custom thresholds that can be used to modify the strictness of the compliance for certain compliance issues. | | |
90
95
  | customComplianceThresholdsPerSight | `Record<string, CustomComplianceThresholds>` | A map associating Sight IDs to custom compliance thresholds. | | |
96
+ | 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. | | |
97
+ | onPictureTaken | `(picture: MonkPicture) => void` | Callback called when the user has taken a picture in the Capture process. | | |
91
98
  | validateButtonLabel | `string` | Custom label for validate button in gallery view. | | |
92
- | enableSightGuideline | `boolean` | Boolean indicating whether the sight guideline feature is enabled. If disabled, the guideline text will be hidden. | | `true` |
93
- | sightGuidelines | `sightGuideline[]` | A collection of sight guidelines in different language with a list of sightIds associate to it. | | |
94
- | enableTutorial | `PhotoCaptureTutorialOption` | Options for displaying the photo capture tutorial. | | `PhotoCaptureTutorialOption.FIRST_TIME_ONLY` |
95
- | allowSkipTutorial | `boolean` | Boolean indicating if the user can skip the PhotoCapture tutorial. | | `true` |
96
- | thumbnailDomain | `string` | The API domain used to communicate with the resize micro service. | ✔️ | |
99
+ | maxUploadDurationWarning | `number` | Max upload duration in milliseconds before showing a bad connection warning to the user. Use `-1` to never display the warning. | | `15000` |
100
+ | useAdaptiveImageQuality | `boolean` | Boolean indicating if the image quality should be downgraded automatically in case of low connection. | | `true` |
101
+ | vehicleType | `VehicleType` | The vehicle type of the inspection. | | `VehicleType.SEDAN` |
102
+
103
+ # VideoCapture
104
+ The VideoCapture workflow is aimed at asking users to record a walkaround video of their vehicle (around ~1min per
105
+ video) to send vehicle inspection pictures to the Monk API. In reality, no video is being recorded. Instead, screenshots
106
+ of the camera stream a repeatidly taken while the users walks around their vehicle. An algorithm is run to select the
107
+ best video frames (the less blurry ones), and they are then sent to the Monk API.
108
+
109
+ Please refer to the [official MonkJs documentation](https://monkvision.github.io/monkjs/docs/photo-capture-workflow) to
110
+ have a detailed overview of the Video Capture workflow.
111
+
112
+ ## VideoCapture component
113
+ This package exports a ready-to-use single-page component called `VideoCapture` that implements the VideoCapture
114
+ workflow. The implementation for it is extremely similar to the `PhotoCapture` component described above. The only
115
+ difference being the configuration options that differ, as well as the fact that you need to pass certain parameters
116
+ when creating your inspection to ake sure it will be able to receive video frames as inputs (if you are creating your
117
+ inspection using the `createInspection` requests of the MonkJs SDK, you can simply set the `isVideoCapture` option to
118
+ `true`).
119
+
120
+ ```tsx
121
+ import { sights } from '@monkvision/sights';
122
+ import { VideoCapture } from '@monkvision/inspection-capture-web';
123
+
124
+ const apiDomain = 'api.preview.monk.ai/v1';
125
+
126
+ export function MonkVideoCapturePage({ authToken }) {
127
+ return (
128
+ <VideoCapture
129
+ inspectionId={inspectionId}
130
+ apiConfig={{ apiDomain, authToken }}
131
+ onComplete={() => { /* Navigate to another page */ }}
132
+ />
133
+ );
134
+ }
135
+ ```
136
+
137
+ Props
138
+
139
+ | Prop | Type | Description | Required | Default Value |
140
+ |------------------------------|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------------------------|
141
+ | format | `CompressionFormat` | The output format of the compression. | | `CompressionFormat.JPEG` |
142
+ | quality | `number` | Value indicating image quality for the compression output. | | `0.6` |
143
+ | resolution | `CameraResolution` | Indicates the resolution of the pictures taken by the Camera. | | `CameraResolution.UHD_4K` |
144
+ | allowImageUpscaling | `boolean` | Allow images to be scaled up if the device does not support the specified resolution in the `resolution` prop. | | `false` |
145
+ | additionalTasks | `TaskName[]` | An optional list of additional tasks to run on every image of the inspection. | | |
146
+ | startTasksOnComplete | `<code>boolean &#124; 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` |
147
+ | enforceOrientation | `DeviceOrientation` | Use this prop to enforce a specific device orientation for the Camera screen. | | |
148
+ | 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. | ✔️ | |
149
+ | 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. | ✔️ | |
150
+ | onComplete | `() => void` | Callback called when inspection capture is complete. | | |
151
+ | lang | <code>string &#124; null</code> | The language to be used by this component. | | `'en'` |
152
+ | minRecordingDuration | `number` | The minimum duration of a recording in milliseconds. | | `15000` |
153
+ | maxRetryCount | `number` | The maximum number of retries for failed image uploads. | | `3` |
154
+ | enableFastWalkingWarning | `boolean` | Boolean indicating if a warning should be shown to the user when they are walking too fast around the vehicle. | | `true` |
155
+ | enablePhoneShakingWarning | `boolean` | Boolean indicating if a warning should be shown to the user when they are shaking their phone too much. | | `true` |
156
+ | fastWalkingWarningCooldown | `number` | The duration (in milliseconds) to wait between fast walking warnings. | | `4000` |
157
+ | phoneShakingWarningCooldown | `number` | The duration (in milliseconds) to wait between phone shaking warnings. | | `4000` |
158
+
159
+ # DamageDisclosure
160
+
161
+ The DamageDisclosure workflow is designed to guide users in documenting and disclosing damage to their vehicles during a Monk inspection.
162
+ This workflow is ideal for capturing detailed images of specific damages such as dents, scratches, or other issues that need to be highlighted in the inspection report.
163
+ There are 2 workflows available.
164
+
165
+ Please refer to the [official MonkJs documentation](https://monkvision.github.io/monkjs/docs/photo-capture-workflow) for a comprehensive overview of the Add damage workflow.
166
+
167
+ ## DamageDisclosure component
168
+
169
+ This package exports a ready-to-use single-page component called DamageDisclosure that implements the DamageDisclosure workflow. You can integrate it into your application by creating a new page containing only this component. Before using it, you must generate an Auth0 authentication token and create a new inspection using the Monk API. Ensure that all task statuses in the inspection are set to NOT_STARTED.
170
+
171
+ You can then pass the inspection ID, API configuration (including the auth token). Once the user completes the workflow, the onComplete callback is triggered, allowing you to navigate to another page or perform additional actions.
172
+
173
+ The following example demonstrates how to use the DamageDisclosure component:
174
+
175
+ ```tsx
176
+ import { DamageDisclosure } from '@monkvision/inspection-capture-web';
177
+
178
+ const apiDomain = 'api.preview.monk.ai/v1';
179
+
180
+ export function MonkDamageDisclosurePage({ authToken }) {
181
+ return (
182
+ <DamageDisclosure
183
+ inspectionId={inspectionId}
184
+ apiConfig={{ apiDomain, authToken }}
185
+ onComplete={() => { /* Navigate to another page */ }}
186
+ />
187
+ );
188
+ }
189
+ ```
97
190
 
191
+ Props
98
192
 
193
+ | Prop | Type | Description | Required | Default Value |
194
+ |--------------------------|----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------------------------------------------|
195
+ | 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. | ✔️ | |
196
+ | 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. | ✔️ | |
197
+ | 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. | | |
198
+ | onComplete | `() => void` | Callback called when inspection capture is complete. | | |
199
+ | onPictureTaken | `(picture: MonkPicture) => void` | Callback called when the user has taken a picture in the Capture process. | | |
200
+ | lang | <code>string &#124; null</code> | The language to be used by this component. | | `'en'` |
201
+ | enforceOrientation | `DeviceOrientation` | Use this prop to enforce a specific device orientation for the Camera screen. | | |
202
+ | maxUploadDurationWarning | `number` | Max upload duration in milliseconds before showing a bad connection warning to the user. Use `-1` to never display the warning. | | `15000` |
203
+ | useAdaptiveImageQuality | `boolean` | Boolean indicating if the image quality should be downgraded automatically in case of low connection. | | `true` |
204
+ | showCloseButton | `boolean` | Indicates if the close button should be displayed in the HUD on top of the Camera preview. | | `false` |
205
+ | format | `CompressionFormat` | The output format of the compression. | | `CompressionFormat.JPEG` |
206
+ | quality | `number` | Value indicating image quality for the compression output. | | `0.6` |
207
+ | resolution | `CameraResolution` | Indicates the resolution of the pictures taken by the Camera. | | `CameraResolution.UHD_4K` |
208
+ | allowImageUpscaling | `boolean` | Allow images to be scaled up if the device does not support the specified resolution in the `resolution` prop. | | `false` |
209
+ | useLiveCompliance | `boolean` | Indicates if live compliance should be enabled or not. | | `false` |
210
+ | validateButtonLabel | `string` | Custom label for validate button in gallery view. | | |
211
+ | thumbnailDomain | `string` | The API domain used to communicate with the resize micro service. | ✔️ | |
212
+ | vehicleType | `VehicleType` | The vehicle type of the inspection. | | `VehicleType.SEDAN` |
213
+ | addDamage | `AddDamage` | Options for Add Damage. If disabled, the `Add Damage` button will be hidden. | | `AddDamage.PART_SELECT` |
@@ -0,0 +1,44 @@
1
+ /// <reference types="react" />
2
+ import { CameraProps } from '@monkvision/camera-web';
3
+ import { MonkApiConfig } from '@monkvision/network';
4
+ import { CameraConfig, PhotoCaptureAppConfig, ComplianceOptions, CompressionOptions, MonkPicture, VehicleType } from '@monkvision/types';
5
+ import { DamageDisclosureHUDProps } from './DamageDisclosureHUD';
6
+ /**
7
+ * Props of the DamageDisclosure component.
8
+ */
9
+ export interface DamageDisclosureProps extends Pick<CameraProps<DamageDisclosureHUDProps>, 'resolution' | 'allowImageUpscaling'>, Pick<PhotoCaptureAppConfig, keyof CameraConfig | 'maxUploadDurationWarning' | 'useAdaptiveImageQuality' | 'showCloseButton' | 'enforceOrientation' | 'addDamage'>, Partial<CompressionOptions>, Partial<ComplianceOptions> {
10
+ /**
11
+ * The ID of the inspection to add images to. Make sure that the user that created the inspection if the same one as
12
+ * the one described in the auth token in the `apiConfig` prop.
13
+ */
14
+ inspectionId: string;
15
+ /**
16
+ * The api config used to communicate with the API. Make sure that the user described in the auth token is the same
17
+ * one as the one that created the inspection provided in the `inspectionId` prop.
18
+ */
19
+ apiConfig: MonkApiConfig;
20
+ /**
21
+ * The vehicle type of the inspection.
22
+ */
23
+ vehicleType?: VehicleType;
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 damage disclosure is complete.
31
+ */
32
+ onComplete?: () => void;
33
+ /**
34
+ * Callback called when a picture has been taken by the user.
35
+ */
36
+ onPictureTaken?: (picture: MonkPicture) => void;
37
+ /**
38
+ * The language to be used by this component.
39
+ *
40
+ * @default en
41
+ */
42
+ lang?: string | null;
43
+ }
44
+ export declare function DamageDisclosure({ inspectionId, apiConfig, onClose, onComplete, onPictureTaken, enableCompliance, complianceIssues, customComplianceThresholds, useLiveCompliance, maxUploadDurationWarning, showCloseButton, addDamage, useAdaptiveImageQuality, lang, enforceOrientation, vehicleType, ...initialCameraConfig }: DamageDisclosureProps): JSX.Element;
@@ -0,0 +1,114 @@
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.DamageDisclosure = 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 types_1 = require("@monkvision/types");
32
+ var react_1 = require("react");
33
+ var react_i18next_1 = require("react-i18next");
34
+ var DamageDisclosure_styles_1 = require("./DamageDisclosure.styles");
35
+ var DamageDisclosureHUD_1 = require("./DamageDisclosureHUD");
36
+ var hooks_1 = require("./hooks");
37
+ var hooks_2 = require("../hooks");
38
+ var types_2 = require("../types");
39
+ // No ts-doc for this component : the component exported is DamageDisclosureHOC
40
+ function DamageDisclosure(_a) {
41
+ var inspectionId = _a.inspectionId, apiConfig = _a.apiConfig, onClose = _a.onClose, onComplete = _a.onComplete, onPictureTaken = _a.onPictureTaken, _b = _a.enableCompliance, enableCompliance = _b === void 0 ? true : _b, complianceIssues = _a.complianceIssues, customComplianceThresholds = _a.customComplianceThresholds, _c = _a.useLiveCompliance, useLiveCompliance = _c === void 0 ? false : _c, _d = _a.maxUploadDurationWarning, maxUploadDurationWarning = _d === void 0 ? 15000 : _d, _e = _a.showCloseButton, showCloseButton = _e === void 0 ? false : _e, _f = _a.addDamage, addDamage = _f === void 0 ? types_1.AddDamage.PART_SELECT : _f, _g = _a.useAdaptiveImageQuality, useAdaptiveImageQuality = _g === void 0 ? true : _g, lang = _a.lang, enforceOrientation = _a.enforceOrientation, _h = _a.vehicleType, vehicleType = _h === void 0 ? types_1.VehicleType.SEDAN : _h, initialCameraConfig = __rest(_a, ["inspectionId", "apiConfig", "onClose", "onComplete", "onPictureTaken", "enableCompliance", "complianceIssues", "customComplianceThresholds", "useLiveCompliance", "maxUploadDurationWarning", "showCloseButton", "addDamage", "useAdaptiveImageQuality", "lang", "enforceOrientation", "vehicleType"]);
42
+ (0, common_1.useI18nSync)(lang);
43
+ var complianceOptions = (0, common_1.useObjectMemo)({
44
+ enableCompliance: enableCompliance,
45
+ complianceIssues: complianceIssues,
46
+ useLiveCompliance: useLiveCompliance,
47
+ customComplianceThresholds: customComplianceThresholds,
48
+ });
49
+ var t = (0, react_i18next_1.useTranslation)().t;
50
+ var _j = (0, react_1.useState)(types_2.CaptureScreen.CAMERA), currentScreen = _j[0], setCurrentScreen = _j[1];
51
+ var dimensions = (0, common_1.useWindowDimensions)();
52
+ var analytics = (0, analytics_1.useAnalytics)();
53
+ var loading = (0, common_1.useLoadingState)();
54
+ var handleOpenGallery = function () {
55
+ setCurrentScreen(types_2.CaptureScreen.GALLERY);
56
+ analytics.trackEvent('Gallery Opened');
57
+ };
58
+ var addDamageHandle = (0, hooks_2.useAddDamageMode)({
59
+ addDamage: addDamage,
60
+ currentScreen: currentScreen,
61
+ damageDisclosure: true,
62
+ handleOpenGallery: handleOpenGallery,
63
+ });
64
+ var disclosureState = (0, hooks_1.useDamageDisclosureState)({
65
+ inspectionId: inspectionId,
66
+ apiConfig: apiConfig,
67
+ loading: loading,
68
+ complianceOptions: complianceOptions,
69
+ });
70
+ (0, hooks_2.useTracking)({ inspectionId: inspectionId, authToken: apiConfig.authToken });
71
+ var _k = (0, hooks_2.useAdaptiveCameraConfig)({
72
+ initialCameraConfig: initialCameraConfig,
73
+ useAdaptiveImageQuality: useAdaptiveImageQuality,
74
+ }), adaptiveCameraConfig = _k.adaptiveCameraConfig, adaptiveUploadEventHandlers = _k.uploadEventHandlers;
75
+ var _l = (0, hooks_2.useBadConnectionWarning)({ maxUploadDurationWarning: maxUploadDurationWarning }), isBadConnectionWarningDialogDisplayed = _l.isBadConnectionWarningDialogDisplayed, closeBadConnectionWarningDialog = _l.closeBadConnectionWarningDialog, badConnectionWarningUploadEventHandlers = _l.uploadEventHandlers;
76
+ var uploadQueue = (0, hooks_2.useUploadQueue)({
77
+ inspectionId: inspectionId,
78
+ apiConfig: apiConfig,
79
+ complianceOptions: complianceOptions,
80
+ eventHandlers: [adaptiveUploadEventHandlers, badConnectionWarningUploadEventHandlers],
81
+ });
82
+ var images = (0, hooks_2.usePhotoCaptureImages)(inspectionId);
83
+ var handlePictureTaken = (0, hooks_2.usePictureTaken)({
84
+ captureState: disclosureState,
85
+ addDamageHandle: addDamageHandle,
86
+ uploadQueue: uploadQueue,
87
+ onPictureTaken: onPictureTaken,
88
+ });
89
+ var handleGalleryBack = function () {
90
+ setCurrentScreen(types_2.CaptureScreen.CAMERA);
91
+ };
92
+ var isViolatingEnforcedOrientation = enforceOrientation &&
93
+ (enforceOrientation === types_1.DeviceOrientation.PORTRAIT) !== dimensions.isPortrait;
94
+ var hudProps = {
95
+ inspectionId: inspectionId,
96
+ mode: addDamageHandle.mode,
97
+ vehicleParts: addDamageHandle.vehicleParts,
98
+ lastPictureTakenUri: disclosureState.lastPictureTakenUri,
99
+ onOpenGallery: handleOpenGallery,
100
+ onAddDamage: addDamageHandle.handleAddDamage,
101
+ onAddDamagePartsSelected: addDamageHandle.handleAddDamagePartsSelected,
102
+ onCancelAddDamage: addDamageHandle.handleCancelAddDamage,
103
+ onRetry: disclosureState.retryLoadingInspection,
104
+ loading: loading,
105
+ onClose: onClose,
106
+ showCloseButton: showCloseButton,
107
+ images: images,
108
+ addDamage: addDamage,
109
+ onValidateVehicleParts: addDamageHandle.handleValidateVehicleParts,
110
+ vehicleType: vehicleType,
111
+ };
112
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: DamageDisclosure_styles_1.styles['container'] }, { children: [currentScreen === types_2.CaptureScreen.CAMERA && isViolatingEnforcedOrientation && ((0, jsx_runtime_1.jsxs)("div", __assign({ style: DamageDisclosure_styles_1.styles['orientationErrorContainer'] }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ style: DamageDisclosure_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: DamageDisclosure_styles_1.styles['orientationErrorTitle'] }, { children: t('photo.orientationError.title') }))] })), (0, jsx_runtime_1.jsx)("div", __assign({ style: DamageDisclosure_styles_1.styles['orientationErrorDescription'] }, { children: t('photo.orientationError.description') }))] }))), currentScreen === types_2.CaptureScreen.CAMERA && !isViolatingEnforcedOrientation && ((0, jsx_runtime_1.jsx)(camera_web_1.Camera, __assign({ HUDComponent: DamageDisclosureHUD_1.DamageDisclosureHUD, onPictureTaken: handlePictureTaken, hudProps: hudProps }, adaptiveCameraConfig))), currentScreen === types_2.CaptureScreen.GALLERY && ((0, jsx_runtime_1.jsx)(common_ui_web_1.InspectionGallery, { inspectionId: inspectionId, sights: [], apiConfig: apiConfig, captureMode: true, lang: lang, showBackButton: true, onBack: handleGalleryBack, onNavigateToCapture: handleGalleryBack, onValidate: onComplete, addDamage: addDamage, validateButtonLabel: t('photo.gallery.next'), isInspectionCompleted: false, filterByImageType: types_1.ImageType.CLOSE_UP })), (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 })] })));
113
+ }
114
+ exports.DamageDisclosure = DamageDisclosure;
@@ -0,0 +1,33 @@
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
+ };
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { DamageDisclosureProps } from './DamageDisclosure';
3
+ /**
4
+ * The DamageDisclosure component is a ready-to-use, single page component that implements a Camera app, allowing users
5
+ * to capture photos of damaged parts of their vehicle for the purpose of disclosing damage. In order to use this
6
+ * component, you first need to generate an Auth0 authentication token, and create an inspection using the Monk Api.
7
+ * When creating the inspection, don't forget to set the tasks statuses to `NOT_STARTED`. You can then pass the
8
+ * inspection ID, the api config (with the auth token) and everything will be handled automatically for you.
9
+ *
10
+ * @example
11
+ * import { DamageDisclosure } from '@monkvision/inspection-capture-web';
12
+ *
13
+ * export function PhotoCaptureScreen({ inspectionId, apiConfig }: PhotoCaptureScreenProps) {
14
+ * const { i18n } = useTranslation();
15
+ *
16
+ * return (
17
+ * <DamageDisclosure
18
+ * inspectionId={inspectionId}
19
+ * apiConfig={apiConfig}
20
+ * compliances={{ iqa: true }}
21
+ * onComplete={() => { / * Navigate to another page * / }}
22
+ * lang={i18n.language}
23
+ * />
24
+ * );
25
+ * }
26
+ */
27
+ export declare const DamageDisclosureHOC: import("react").ForwardRefExoticComponent<DamageDisclosureProps & import("react").RefAttributes<unknown>>;
@@ -0,0 +1,45 @@
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.DamageDisclosureHOC = 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 DamageDisclosure_1 = require("./DamageDisclosure");
19
+ /**
20
+ * The DamageDisclosure component is a ready-to-use, single page component that implements a Camera app, allowing users
21
+ * to capture photos of damaged parts of their vehicle for the purpose of disclosing damage. 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`. You can then pass the
24
+ * inspection ID, the api config (with the auth token) and everything will be handled automatically for you.
25
+ *
26
+ * @example
27
+ * import { DamageDisclosure } from '@monkvision/inspection-capture-web';
28
+ *
29
+ * export function PhotoCaptureScreen({ inspectionId, apiConfig }: PhotoCaptureScreenProps) {
30
+ * const { i18n } = useTranslation();
31
+ *
32
+ * return (
33
+ * <DamageDisclosure
34
+ * inspectionId={inspectionId}
35
+ * apiConfig={apiConfig}
36
+ * compliances={{ iqa: true }}
37
+ * onComplete={() => { / * Navigate to another page * / }}
38
+ * lang={i18n.language}
39
+ * />
40
+ * );
41
+ * }
42
+ */
43
+ exports.DamageDisclosureHOC = (0, common_1.i18nWrap)(function DamageDisclosureHOC(props) {
44
+ return ((0, jsx_runtime_1.jsx)(common_1.MonkProvider, { children: (0, jsx_runtime_1.jsx)(DamageDisclosure_1.DamageDisclosure, __assign({}, props)) }));
45
+ }, i18n_1.i18nInspectionCaptureWeb);
@@ -0,0 +1,73 @@
1
+ /// <reference types="react" />
2
+ import { PhotoCaptureAppConfig, Image, VehiclePart, VehicleType } from '@monkvision/types';
3
+ import { CameraHUDProps } from '@monkvision/camera-web';
4
+ import { LoadingState } from '@monkvision/common';
5
+ import { CaptureMode } from '../../types';
6
+ /**
7
+ * Props of the DamageDisclosureHUD component.
8
+ */
9
+ export interface DamageDisclosureHUDProps extends CameraHUDProps, Pick<PhotoCaptureAppConfig, 'addDamage' | 'showCloseButton'> {
10
+ /**
11
+ * The inspection ID.
12
+ */
13
+ inspectionId: string;
14
+ /**
15
+ * The current mode of the component.
16
+ */
17
+ mode: CaptureMode;
18
+ /**
19
+ * Global loading state of the DamageDisclosure component.
20
+ */
21
+ loading: LoadingState;
22
+ /**
23
+ * Current vehicle parts selected to take a picture of.
24
+ */
25
+ vehicleParts: VehiclePart[];
26
+ /**
27
+ * Value storing the last picture taken by the user. If no picture has been taken yet, this value is null.
28
+ */
29
+ lastPictureTakenUri: string | null;
30
+ /**
31
+ * Callback called when the user clicks on the "Add Damage" button.
32
+ */
33
+ onAddDamage: () => void;
34
+ /**
35
+ * Callback called when the user selects the parts to take a picture of.
36
+ */
37
+ onAddDamagePartsSelected?: (parts: VehiclePart[]) => void;
38
+ /**
39
+ * Callback called when the user clicks on the "Cancel" button of the Add Damage mode.
40
+ */
41
+ onCancelAddDamage: () => void;
42
+ /**
43
+ * Callback that can be used to retry fetching this state object from the API in case the previous fetch failed.
44
+ */
45
+ onRetry: () => void;
46
+ /**
47
+ * Callback called when the user clicks on the gallery icon.
48
+ */
49
+ onOpenGallery: () => void;
50
+ /**
51
+ * Callback called when the user clicks on the "Validate" button of the Add Damage mode.
52
+ */
53
+ onValidateVehicleParts: () => void;
54
+ /**
55
+ * Callback called when the user clicks on the close button. If this callback is not provided, the close button is not
56
+ * displayed.
57
+ */
58
+ onClose?: () => void;
59
+ /**
60
+ * The current images taken by the user (ignoring retaken pictures etc.).
61
+ */
62
+ images: Image[];
63
+ /**
64
+ * The vehicle type of the inspection.
65
+ */
66
+ vehicleType: VehicleType;
67
+ }
68
+ /**
69
+ * This component implements the Camera HUD (head-up display) displayed in the DamageDisclosure component
70
+ * over the Camera preview. It implements elements such as buttons to interact with
71
+ * the camera, DamageDisclosure indicators, error messages, loaders etc.
72
+ */
73
+ export declare function DamageDisclosureHUD({ inspectionId, lastPictureTakenUri, mode, vehicleParts, addDamage, onAddDamage, onAddDamagePartsSelected, onValidateVehicleParts, onCancelAddDamage, onOpenGallery, onClose, onRetry, showCloseButton, loading, handle, cameraPreview, images, vehicleType, }: DamageDisclosureHUDProps): JSX.Element;
@@ -0,0 +1,49 @@
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.DamageDisclosureHUD = void 0;
15
+ var jsx_runtime_1 = require("react/jsx-runtime");
16
+ var react_1 = require("react");
17
+ var types_1 = require("@monkvision/types");
18
+ var react_i18next_1 = require("react-i18next");
19
+ var common_ui_web_1 = require("@monkvision/common-ui-web");
20
+ var analytics_1 = require("@monkvision/analytics");
21
+ var DamageDisclosureHUD_styles_1 = require("./DamageDisclosureHUD.styles");
22
+ var types_2 = require("../../types");
23
+ var HUDButtons_1 = require("../../components/HUDButtons");
24
+ var DamageDisclosureHUDElements_1 = require("./DamageDisclosureHUDElements");
25
+ var HUDOverlay_1 = require("../../components/HUDOverlay");
26
+ /**
27
+ * This component implements the Camera HUD (head-up display) displayed in the DamageDisclosure component
28
+ * over the Camera preview. It implements elements such as buttons to interact with
29
+ * the camera, DamageDisclosure indicators, error messages, loaders etc.
30
+ */
31
+ function DamageDisclosureHUD(_a) {
32
+ var _b;
33
+ var inspectionId = _a.inspectionId, lastPictureTakenUri = _a.lastPictureTakenUri, mode = _a.mode, vehicleParts = _a.vehicleParts, addDamage = _a.addDamage, onAddDamage = _a.onAddDamage, onAddDamagePartsSelected = _a.onAddDamagePartsSelected, onValidateVehicleParts = _a.onValidateVehicleParts, onCancelAddDamage = _a.onCancelAddDamage, onOpenGallery = _a.onOpenGallery, onClose = _a.onClose, onRetry = _a.onRetry, showCloseButton = _a.showCloseButton, loading = _a.loading, handle = _a.handle, cameraPreview = _a.cameraPreview, images = _a.images, vehicleType = _a.vehicleType;
34
+ var t = (0, react_i18next_1.useTranslation)().t;
35
+ var _c = (0, react_1.useState)(false), showCloseModal = _c[0], setShowCloseModal = _c[1];
36
+ var trackEvent = (0, analytics_1.useAnalytics)().trackEvent;
37
+ var retakeCount = (0, react_1.useMemo)(function () {
38
+ return images.filter(function (image) {
39
+ return [types_1.ImageStatus.NOT_COMPLIANT, types_1.ImageStatus.UPLOAD_FAILED, types_1.ImageStatus.UPLOAD_ERROR].includes(image.status) && image.type === types_1.ImageType.CLOSE_UP;
40
+ }).length;
41
+ }, [images]);
42
+ var handleCloseConfirm = function () {
43
+ setShowCloseModal(false);
44
+ trackEvent('Disclosure Closed');
45
+ onClose === null || onClose === void 0 ? void 0 : onClose();
46
+ };
47
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: DamageDisclosureHUD_styles_1.styles['container'] }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ style: DamageDisclosureHUD_styles_1.styles['previewContainer'], "data-testid": 'camera-preview' }, { children: [cameraPreview, (0, jsx_runtime_1.jsx)(DamageDisclosureHUDElements_1.DamageDisclosureHUDElements, { mode: mode, addDamage: addDamage, vehicleParts: vehicleParts, onAddDamage: onAddDamage, onCancelAddDamage: onCancelAddDamage, onAddDamagePartsSelected: onAddDamagePartsSelected, onValidateVehicleParts: onValidateVehicleParts, isLoading: loading.isLoading, error: (_b = loading.error) !== null && _b !== void 0 ? _b : handle.error, previewDimensions: handle.previewDimensions, vehicleType: vehicleType })] })), mode !== types_2.CaptureMode.ADD_DAMAGE_PART_SELECT && ((0, jsx_runtime_1.jsx)(HUDButtons_1.HUDButtons, { onOpenGallery: onOpenGallery, onTakePicture: handle === null || handle === void 0 ? void 0 : handle.takePicture, onClose: function () { return setShowCloseModal(true); }, galleryPreview: lastPictureTakenUri !== null && lastPictureTakenUri !== void 0 ? lastPictureTakenUri : undefined, closeDisabled: !!loading.error || !!handle.error, galleryDisabled: !!loading.error || !!handle.error, takePictureDisabled: !!loading.error || !!handle.error || handle.isLoading || loading.isLoading, showCloseButton: showCloseButton, showGalleryBadge: retakeCount > 0, retakeCount: retakeCount })), (0, jsx_runtime_1.jsx)(HUDOverlay_1.HUDOverlay, { inspectionId: inspectionId, handle: handle, isCaptureLoading: loading.isLoading, captureError: loading.error, onRetry: onRetry }), (0, jsx_runtime_1.jsx)(common_ui_web_1.BackdropDialog, { show: showCloseModal, message: t('photo.hud.closeConfirm.message'), cancelLabel: t('photo.hud.closeConfirm.cancel'), confirmLabel: t('photo.hud.closeConfirm.confirm'), onCancel: function () { return setShowCloseModal(false); }, onConfirm: handleCloseConfirm })] })));
48
+ }
49
+ exports.DamageDisclosureHUD = DamageDisclosureHUD;