@monkvision/inspection-capture-web 4.5.6 → 5.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.
Files changed (246) hide show
  1. package/README.md +134 -19
  2. package/lib/DamageDisclosure/DamageDisclosure.d.ts +44 -0
  3. package/lib/DamageDisclosure/DamageDisclosure.js +112 -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 +50 -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 +3 -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 +6 -4
  40. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.styles.js +10 -3
  41. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/hooks.d.ts +813 -0
  42. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/hooks.js +23 -0
  43. package/lib/PhotoCapture/PhotoCaptureHUD/hooks/index.d.ts +0 -1
  44. package/lib/PhotoCapture/PhotoCaptureHUD/hooks/index.js +0 -1
  45. package/lib/PhotoCapture/PhotoCaptureHUD/index.d.ts +0 -6
  46. package/lib/PhotoCapture/PhotoCaptureHUD/index.js +0 -6
  47. package/lib/PhotoCapture/hooks/index.d.ts +0 -8
  48. package/lib/PhotoCapture/hooks/index.js +0 -8
  49. package/lib/PhotoCapture/hooks/usePhotoCaptureSightState.d.ts +3 -0
  50. package/lib/PhotoCapture/hooks/usePhotoCaptureSightState.js +1 -1
  51. package/lib/PhotoCapture/hooks/usePhotoCaptureTutorial.d.ts +2 -2
  52. package/lib/VideoCapture/VideoCapture.d.ts +28 -0
  53. package/lib/VideoCapture/VideoCapture.js +81 -0
  54. package/lib/VideoCapture/VideoCapture.styles.js +9 -0
  55. package/lib/VideoCapture/VideoCaptureHOC.d.ts +27 -0
  56. package/lib/VideoCapture/VideoCaptureHOC.js +45 -0
  57. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureHUD.d.ts +44 -0
  58. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureHUD.js +158 -0
  59. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureHUD.styles.js +14 -0
  60. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.d.ts +6 -0
  61. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.js +38 -0
  62. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.types.d.ts +33 -0
  63. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.types.js +2 -0
  64. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecordingStyles.d.ts +4873 -0
  65. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecordingStyles.js +105 -0
  66. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/index.d.ts +2 -0
  67. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/index.js +5 -0
  68. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/VideoCaptureTutorial.d.ts +14 -0
  69. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/VideoCaptureTutorial.js +30 -0
  70. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/index.d.ts +1 -0
  71. package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/index.js +5 -0
  72. package/lib/VideoCapture/VideoCaptureHUD/index.d.ts +1 -0
  73. package/lib/VideoCapture/VideoCaptureHUD/index.js +5 -0
  74. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.d.ts +23 -0
  75. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.js +26 -0
  76. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.styles.d.ts +12 -0
  77. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.styles.js +72 -0
  78. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/index.d.ts +1 -0
  79. package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/index.js +5 -0
  80. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.d.ts +7 -0
  81. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.js +32 -0
  82. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.styles.d.ts +12 -0
  83. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.styles.js +87 -0
  84. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.types.d.ts +22 -0
  85. package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.types.js +2 -0
  86. package/lib/VideoCapture/VideoCapturePageLayout/index.d.ts +3 -0
  87. package/lib/VideoCapture/VideoCapturePageLayout/index.js +7 -0
  88. package/lib/VideoCapture/VideoCapturePermissions/VideoCapturePermissions.d.ts +19 -0
  89. package/lib/VideoCapture/VideoCapturePermissions/VideoCapturePermissions.js +107 -0
  90. package/lib/VideoCapture/VideoCapturePermissions/index.d.ts +1 -0
  91. package/lib/VideoCapture/VideoCapturePermissions/index.js +5 -0
  92. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.d.ts +7 -0
  93. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.js +44 -0
  94. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.styles.d.ts +2437 -0
  95. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.styles.js +60 -0
  96. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.types.d.ts +34 -0
  97. package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.types.js +2 -0
  98. package/lib/VideoCapture/VideoCaptureProcessing/index.d.ts +2 -0
  99. package/lib/VideoCapture/VideoCaptureProcessing/index.js +5 -0
  100. package/lib/VideoCapture/hooks/index.d.ts +5 -0
  101. package/lib/VideoCapture/hooks/index.js +21 -0
  102. package/lib/VideoCapture/hooks/useFastMovementsDetection/fastMovementsDetection.d.ts +18 -0
  103. package/lib/VideoCapture/hooks/useFastMovementsDetection/fastMovementsDetection.js +45 -0
  104. package/lib/VideoCapture/hooks/useFastMovementsDetection/index.d.ts +2 -0
  105. package/lib/VideoCapture/hooks/useFastMovementsDetection/index.js +20 -0
  106. package/lib/VideoCapture/hooks/useFastMovementsDetection/useFastMovementsDetection.d.ts +34 -0
  107. package/lib/VideoCapture/hooks/useFastMovementsDetection/useFastMovementsDetection.js +64 -0
  108. package/lib/VideoCapture/hooks/useFrameSelection/index.d.ts +1 -0
  109. package/lib/VideoCapture/hooks/useFrameSelection/index.js +17 -0
  110. package/lib/VideoCapture/hooks/useFrameSelection/laplaceScores.d.ts +16 -0
  111. package/lib/VideoCapture/hooks/useFrameSelection/laplaceScores.js +62 -0
  112. package/lib/VideoCapture/hooks/useFrameSelection/useFrameSelection.d.ts +43 -0
  113. package/lib/VideoCapture/hooks/useFrameSelection/useFrameSelection.js +50 -0
  114. package/lib/VideoCapture/hooks/useVehicleWalkaround.d.ts +26 -0
  115. package/lib/VideoCapture/hooks/useVehicleWalkaround.js +39 -0
  116. package/lib/VideoCapture/hooks/useVideoRecording.d.ts +97 -0
  117. package/lib/VideoCapture/hooks/useVideoRecording.js +140 -0
  118. package/lib/VideoCapture/hooks/useVideoUploadQueue.d.ts +40 -0
  119. package/lib/VideoCapture/hooks/useVideoUploadQueue.js +51 -0
  120. package/lib/VideoCapture/index.d.ts +2 -0
  121. package/lib/VideoCapture/index.js +5 -0
  122. package/lib/assets/logos.asset.d.ts +1 -0
  123. package/lib/assets/logos.asset.js +4 -0
  124. package/lib/components/CancelButton/CancelButton.d.ts +14 -0
  125. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/PhotoCaptureHUDCancelButton.js → components/CancelButton/CancelButton.js} +6 -6
  126. package/lib/components/CancelButton/index.d.ts +1 -0
  127. package/lib/components/CancelButton/index.js +5 -0
  128. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.d.ts → components/CloseUpShot/CloseUpShot.d.ts} +10 -4
  129. package/lib/components/CloseUpShot/CloseUpShot.js +34 -0
  130. package/lib/components/CloseUpShot/CloseUpShot.styles.d.ts +2 -0
  131. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.styles.js → components/CloseUpShot/CloseUpShot.styles.js} +4 -3
  132. package/lib/components/CloseUpShot/hooks.d.ts +7 -0
  133. package/lib/components/CloseUpShot/hooks.js +25 -0
  134. package/lib/components/CloseUpShot/index.d.ts +1 -0
  135. package/lib/components/CloseUpShot/index.js +5 -0
  136. package/lib/components/Counter/Counter.d.ts +6 -0
  137. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.js → components/Counter/Counter.js} +9 -9
  138. package/lib/components/Counter/Counter.styles.d.ts +2 -0
  139. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter → components/Counter}/hooks.d.ts +6 -6
  140. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter → components/Counter}/hooks.js +6 -6
  141. package/lib/components/Counter/index.d.ts +2 -0
  142. package/lib/components/Counter/index.js +5 -0
  143. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.d.ts → components/HUDButtons/HUDButtons.d.ts} +4 -4
  144. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.js → components/HUDButtons/HUDButtons.js} +5 -5
  145. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons → components/HUDButtons}/hooks.d.ts +3 -3
  146. package/lib/components/HUDButtons/hooks.js +44 -0
  147. package/lib/components/HUDButtons/index.d.ts +1 -0
  148. package/lib/components/HUDButtons/index.js +5 -0
  149. package/lib/components/HUDOverlay/HUDOverlay.d.ts +7 -0
  150. package/lib/components/HUDOverlay/HUDOverlay.js +36 -0
  151. package/lib/components/HUDOverlay/HUDOverlay.styles.d.ts +2 -0
  152. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay → components/HUDOverlay}/hooks.d.ts +4 -4
  153. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay → components/HUDOverlay}/hooks.js +3 -3
  154. package/lib/components/HUDOverlay/index.d.ts +2 -0
  155. package/lib/components/HUDOverlay/index.js +5 -0
  156. package/lib/components/OrientationEnforcer/OrientationEnforcer.d.ts +16 -0
  157. package/lib/components/OrientationEnforcer/OrientationEnforcer.js +34 -0
  158. package/lib/components/OrientationEnforcer/OrientationEnforcer.styles.d.ts +815 -0
  159. package/lib/components/OrientationEnforcer/OrientationEnforcer.styles.js +49 -0
  160. package/lib/components/OrientationEnforcer/index.d.ts +1 -0
  161. package/lib/components/OrientationEnforcer/index.js +5 -0
  162. package/lib/components/PartSelection/PartSelection.d.ts +40 -0
  163. package/lib/components/PartSelection/PartSelection.js +39 -0
  164. package/lib/components/PartSelection/PartSelection.styles.d.ts +2 -0
  165. package/lib/components/PartSelection/PartSelection.styles.js +54 -0
  166. package/lib/components/PartSelection/index.d.ts +2 -0
  167. package/lib/components/PartSelection/index.js +5 -0
  168. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.d.ts → components/ZoomOutShot/ZoomOutShot.d.ts} +3 -3
  169. package/lib/components/ZoomOutShot/ZoomOutShot.js +38 -0
  170. package/lib/components/ZoomOutShot/ZoomOutShot.styles.d.ts +2 -0
  171. package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.styles.js → components/ZoomOutShot/ZoomOutShot.styles.js} +3 -3
  172. package/lib/components/ZoomOutShot/hooks.d.ts +6 -0
  173. package/lib/components/ZoomOutShot/hooks.js +24 -0
  174. package/lib/components/ZoomOutShot/index.d.ts +1 -0
  175. package/lib/components/ZoomOutShot/index.js +5 -0
  176. package/lib/components/index.d.ts +8 -0
  177. package/lib/components/index.js +24 -0
  178. package/lib/errors.d.ts +3 -0
  179. package/lib/errors.js +7 -0
  180. package/lib/hooks/index.d.ts +10 -0
  181. package/lib/hooks/index.js +26 -0
  182. package/lib/{PhotoCapture/hooks → hooks}/useAdaptiveCameraConfig.d.ts +2 -2
  183. package/lib/hooks/useAddDamageMode.d.ts +56 -0
  184. package/lib/hooks/useAddDamageMode.js +76 -0
  185. package/lib/{PhotoCapture/hooks → hooks}/useBadConnectionWarning.d.ts +2 -2
  186. package/lib/hooks/useColorBackground.d.ts +4 -0
  187. package/lib/hooks/useColorBackground.js +15 -0
  188. package/lib/hooks/useEnforceOrientation.d.ts +6 -0
  189. package/lib/hooks/useEnforceOrientation.js +14 -0
  190. package/lib/{PhotoCapture/hooks → hooks}/usePhotoCaptureImages.js +1 -1
  191. package/lib/{PhotoCapture/hooks → hooks}/usePictureTaken.d.ts +4 -4
  192. package/lib/hooks/usePictureTaken.js +58 -0
  193. package/lib/{PhotoCapture/hooks → hooks}/useStartTasksOnComplete.d.ts +6 -6
  194. package/lib/{PhotoCapture/hooks → hooks}/useStartTasksOnComplete.js +3 -1
  195. package/lib/{PhotoCapture/hooks → hooks}/useUploadQueue.d.ts +24 -7
  196. package/lib/{PhotoCapture/hooks → hooks}/useUploadQueue.js +14 -4
  197. package/lib/index.d.ts +2 -0
  198. package/lib/index.js +2 -0
  199. package/lib/translations/de.json +64 -5
  200. package/lib/translations/en.json +64 -5
  201. package/lib/translations/fr.json +64 -5
  202. package/lib/translations/nl.json +64 -5
  203. package/lib/types.d.ts +102 -0
  204. package/lib/types.js +43 -0
  205. package/package.json +15 -15
  206. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/hooks.js +0 -44
  207. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/index.d.ts +0 -1
  208. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/index.js +0 -5
  209. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/PhotoCaptureHUDCancelButton.d.ts +0 -14
  210. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/index.d.ts +0 -1
  211. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/index.js +0 -5
  212. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.d.ts +0 -6
  213. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/index.d.ts +0 -2
  214. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/index.js +0 -5
  215. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.js +0 -38
  216. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/hooks.d.ts +0 -6
  217. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/hooks.js +0 -24
  218. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/index.d.ts +0 -1
  219. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/index.js +0 -5
  220. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.js +0 -40
  221. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/hooks.d.ts +0 -7
  222. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/hooks.js +0 -25
  223. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/index.d.ts +0 -1
  224. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/index.js +0 -5
  225. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.d.ts +0 -7
  226. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.js +0 -36
  227. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/index.d.ts +0 -2
  228. package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/index.js +0 -5
  229. package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDButtonBackground.d.ts +0 -4
  230. package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDButtonBackground.js +0 -13
  231. package/lib/PhotoCapture/hooks/useAddDamageMode.d.ts +0 -42
  232. package/lib/PhotoCapture/hooks/useAddDamageMode.js +0 -57
  233. package/lib/PhotoCapture/hooks/usePictureTaken.js +0 -46
  234. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.styles.d.ts → DamageDisclosure/DamageDisclosure.styles.d.ts} +0 -0
  235. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.styles.d.ts → DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.styles.d.ts} +0 -0
  236. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.styles.d.ts → VideoCapture/VideoCapture.styles.d.ts} +0 -0
  237. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.styles.d.ts → VideoCapture/VideoCaptureHUD/VideoCaptureHUD.styles.d.ts} +0 -0
  238. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.styles.js → components/Counter/Counter.styles.js} +0 -0
  239. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.styles.d.ts → components/HUDButtons/HUDButtons.styles.d.ts} +0 -0
  240. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.styles.js → components/HUDButtons/HUDButtons.styles.js} +0 -0
  241. /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.styles.js → components/HUDOverlay/HUDOverlay.styles.js} +0 -0
  242. /package/lib/{PhotoCapture/hooks → hooks}/useAdaptiveCameraConfig.js +0 -0
  243. /package/lib/{PhotoCapture/hooks → hooks}/useBadConnectionWarning.js +0 -0
  244. /package/lib/{PhotoCapture/hooks → hooks}/usePhotoCaptureImages.d.ts +0 -0
  245. /package/lib/{PhotoCapture/hooks → hooks}/useTracking.d.ts +0 -0
  246. /package/lib/{PhotoCapture/hooks → hooks}/useTracking.js +0 -0
@@ -0,0 +1,23 @@
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.usePhotoCaptureHUDTutorialStyle = void 0;
15
+ var common_1 = require("@monkvision/common");
16
+ var PhotoCaptureHUDTutorial_styles_1 = require("./PhotoCaptureHUDTutorial.styles");
17
+ function usePhotoCaptureHUDTutorialStyle() {
18
+ var responsive = (0, common_1.useResponsiveStyle)().responsive;
19
+ return {
20
+ elementsContainer: __assign(__assign({}, PhotoCaptureHUDTutorial_styles_1.styles['elementsContainer']), responsive(PhotoCaptureHUDTutorial_styles_1.styles['elementsContainerPortrait'])),
21
+ };
22
+ }
23
+ exports.usePhotoCaptureHUDTutorialStyle = usePhotoCaptureHUDTutorialStyle;
@@ -1,2 +1 @@
1
1
  export * from './usePhotoCaptureHUDStyle';
2
- export * from './usePhotoCaptureHUDButtonBackground';
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./usePhotoCaptureHUDStyle"), exports);
18
- __exportStar(require("./usePhotoCaptureHUDButtonBackground"), exports);
@@ -1,11 +1,5 @@
1
1
  export { PhotoCaptureHUD, type PhotoCaptureHUDProps } from './PhotoCaptureHUD';
2
2
  export * from './hooks';
3
- export * from './PhotoCaptureHUDButtons';
4
- export * from './PhotoCaptureHUDCancelButton';
5
- export * from './PhotoCaptureHUDCounter';
6
- export * from './PhotoCaptureHUDOverlay';
7
3
  export * from './PhotoCaptureHUDElements';
8
- export * from './PhotoCaptureHUDElementsAddDamage1stShot';
9
- export * from './PhotoCaptureHUDElementsAddDamage2ndShot';
10
4
  export * from './PhotoCaptureHUDElementsSight';
11
5
  export * from './PhotoCaptureHUDTutorial';
@@ -18,12 +18,6 @@ exports.PhotoCaptureHUD = void 0;
18
18
  var PhotoCaptureHUD_1 = require("./PhotoCaptureHUD");
19
19
  Object.defineProperty(exports, "PhotoCaptureHUD", { enumerable: true, get: function () { return PhotoCaptureHUD_1.PhotoCaptureHUD; } });
20
20
  __exportStar(require("./hooks"), exports);
21
- __exportStar(require("./PhotoCaptureHUDButtons"), exports);
22
- __exportStar(require("./PhotoCaptureHUDCancelButton"), exports);
23
- __exportStar(require("./PhotoCaptureHUDCounter"), exports);
24
- __exportStar(require("./PhotoCaptureHUDOverlay"), exports);
25
21
  __exportStar(require("./PhotoCaptureHUDElements"), exports);
26
- __exportStar(require("./PhotoCaptureHUDElementsAddDamage1stShot"), exports);
27
- __exportStar(require("./PhotoCaptureHUDElementsAddDamage2ndShot"), exports);
28
22
  __exportStar(require("./PhotoCaptureHUDElementsSight"), exports);
29
23
  __exportStar(require("./PhotoCaptureHUDTutorial"), exports);
@@ -1,11 +1,3 @@
1
1
  export * from './usePhotoCaptureSightState';
2
- export * from './useStartTasksOnComplete';
3
- export * from './useAddDamageMode';
4
- export * from './useUploadQueue';
5
- export * from './usePictureTaken';
6
- export * from './usePhotoCaptureImages';
7
2
  export * from './useComplianceAnalytics';
8
- export * from './useBadConnectionWarning';
9
- export * from './useAdaptiveCameraConfig';
10
- export * from './useTracking';
11
3
  export * from './usePhotoCaptureTutorial';
@@ -15,13 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./usePhotoCaptureSightState"), exports);
18
- __exportStar(require("./useStartTasksOnComplete"), exports);
19
- __exportStar(require("./useAddDamageMode"), exports);
20
- __exportStar(require("./useUploadQueue"), exports);
21
- __exportStar(require("./usePictureTaken"), exports);
22
- __exportStar(require("./usePhotoCaptureImages"), exports);
23
18
  __exportStar(require("./useComplianceAnalytics"), exports);
24
- __exportStar(require("./useBadConnectionWarning"), exports);
25
- __exportStar(require("./useAdaptiveCameraConfig"), exports);
26
- __exportStar(require("./useTracking"), exports);
27
19
  __exportStar(require("./usePhotoCaptureTutorial"), exports);
@@ -75,6 +75,9 @@ export interface PhotoCaptureSightsParams {
75
75
  * The options for the compliance conf
76
76
  */
77
77
  complianceOptions: ComplianceOptions;
78
+ /**
79
+ * Callback used to manually update the completion state of the inspection.
80
+ */
78
81
  setIsInitialInspectionFetched: (state: boolean) => void;
79
82
  /**
80
83
  * Record associating each sight with a list of tasks to execute for it. If not provided, the default tasks of the
@@ -99,7 +99,7 @@ function usePhotoCaptureSightState(_a) {
99
99
  var notCompliantSights = captureSights
100
100
  .map(function (s) { return ({
101
101
  sight: s,
102
- image: (0, common_1.getInspectionImages)(inspectionId, state.images, true).find(function (i) { return i.inspectionId === inspectionId && i.sightId === s.id; }),
102
+ image: (0, common_1.getInspectionImages)(inspectionId, state.images, undefined, true).find(function (i) { return i.inspectionId === inspectionId && i.sightId === s.id; }),
103
103
  }); })
104
104
  .filter(function (_a) {
105
105
  var image = _a.image;
@@ -1,4 +1,4 @@
1
- import { CaptureAppConfig } from '@monkvision/types';
1
+ import { PhotoCaptureAppConfig } from '@monkvision/types';
2
2
  export declare const STORAGE_KEY_PHOTO_CAPTURE_TUTORIAL = "@monk_photoCaptureTutorial";
3
3
  /**
4
4
  * Enum of the different steps of the PhotoCapture Tutorial component.
@@ -24,7 +24,7 @@ export declare enum TutorialSteps {
24
24
  /**
25
25
  * Parameters of the usePhotoCaptureTutorial hook.
26
26
  */
27
- export interface PhotoCaptureTutorial extends Pick<CaptureAppConfig, 'enableTutorial' | 'enableSightTutorial' | 'enableSightGuidelines'> {
27
+ export interface PhotoCaptureTutorial extends Pick<PhotoCaptureAppConfig, 'enableTutorial' | 'enableSightTutorial' | 'enableSightGuidelines'> {
28
28
  }
29
29
  /**
30
30
  * Custom hook used to manage the state of photo capture tutorial.
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import { MonkApiConfig } from '@monkvision/network';
3
+ import { CameraConfig, VideoCaptureAppConfig } from '@monkvision/types';
4
+ /**
5
+ * Props of the VideoCapture component.
6
+ */
7
+ export interface VideoCaptureProps extends Pick<VideoCaptureAppConfig, keyof CameraConfig | 'additionalTasks' | 'startTasksOnComplete' | 'enforceOrientation' | 'minRecordingDuration' | 'maxRetryCount' | 'enableFastWalkingWarning' | 'enablePhoneShakingWarning' | 'fastWalkingWarningCooldown' | 'phoneShakingWarningCooldown'> {
8
+ /**
9
+ * The ID of the inspection to add the video frames to.
10
+ */
11
+ inspectionId: string;
12
+ /**
13
+ * The api config used to communicate with the API. Make sure that the user described in the auth token is the same
14
+ * one as the one that created the inspection provided in the `inspectionId` prop.
15
+ */
16
+ apiConfig: MonkApiConfig;
17
+ /**
18
+ * Callback called when the inspection is complete.
19
+ */
20
+ onComplete?: () => void;
21
+ /**
22
+ * The language to be used by this component.
23
+ *
24
+ * @default en
25
+ */
26
+ lang?: string | null;
27
+ }
28
+ export declare function VideoCapture({ inspectionId, apiConfig, additionalTasks, startTasksOnComplete, enforceOrientation, minRecordingDuration, maxRetryCount, enableFastWalkingWarning, enablePhoneShakingWarning, fastWalkingWarningCooldown, phoneShakingWarningCooldown, onComplete, lang, }: VideoCaptureProps): JSX.Element;
@@ -0,0 +1,81 @@
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.VideoCapture = void 0;
15
+ var jsx_runtime_1 = require("react/jsx-runtime");
16
+ var common_1 = require("@monkvision/common");
17
+ var react_1 = require("react");
18
+ var camera_web_1 = require("@monkvision/camera-web");
19
+ var monitoring_1 = require("@monkvision/monitoring");
20
+ var VideoCapture_styles_1 = require("./VideoCapture.styles");
21
+ var VideoCapturePermissions_1 = require("./VideoCapturePermissions");
22
+ var VideoCaptureHUD_1 = require("./VideoCaptureHUD");
23
+ var hooks_1 = require("../hooks");
24
+ var hooks_2 = require("./hooks");
25
+ var VideoCaptureScreen;
26
+ (function (VideoCaptureScreen) {
27
+ VideoCaptureScreen["PERMISSIONS"] = "permissions";
28
+ VideoCaptureScreen["CAPTURE"] = "capture";
29
+ })(VideoCaptureScreen || (VideoCaptureScreen = {}));
30
+ // No ts-doc for this component : the component exported is VideoCaptureHOC
31
+ function VideoCapture(_a) {
32
+ var inspectionId = _a.inspectionId, apiConfig = _a.apiConfig, additionalTasks = _a.additionalTasks, startTasksOnComplete = _a.startTasksOnComplete, enforceOrientation = _a.enforceOrientation, _b = _a.minRecordingDuration, minRecordingDuration = _b === void 0 ? 15000 : _b, _c = _a.maxRetryCount, maxRetryCount = _c === void 0 ? 3 : _c, _d = _a.enableFastWalkingWarning, enableFastWalkingWarning = _d === void 0 ? true : _d, _e = _a.enablePhoneShakingWarning, enablePhoneShakingWarning = _e === void 0 ? true : _e, _f = _a.fastWalkingWarningCooldown, fastWalkingWarningCooldown = _f === void 0 ? 1000 : _f, _g = _a.phoneShakingWarningCooldown, phoneShakingWarningCooldown = _g === void 0 ? 1000 : _g, onComplete = _a.onComplete, lang = _a.lang;
33
+ (0, common_1.useI18nSync)(lang);
34
+ var _h = (0, react_1.useState)(VideoCaptureScreen.PERMISSIONS), screen = _h[0], setScreen = _h[1];
35
+ var _j = (0, react_1.useState)(false), isRecording = _j[0], setIsRecording = _j[1];
36
+ var handleError = (0, monitoring_1.useMonitoring)().handleError;
37
+ var _k = (0, hooks_2.useFastMovementsDetection)({
38
+ isRecording: isRecording,
39
+ enableFastWalkingWarning: enableFastWalkingWarning,
40
+ enablePhoneShakingWarning: enablePhoneShakingWarning,
41
+ fastWalkingWarningCooldown: fastWalkingWarningCooldown,
42
+ phoneShakingWarningCooldown: phoneShakingWarningCooldown,
43
+ }), onDeviceOrientationEvent = _k.onDeviceOrientationEvent, fastMovementsWarning = _k.fastMovementsWarning, onWarningDismiss = _k.onWarningDismiss;
44
+ var _l = (0, common_1.useDeviceOrientation)({ onDeviceOrientationEvent: onDeviceOrientationEvent }), alpha = _l.alpha, requestCompassPermission = _l.requestCompassPermission;
45
+ var startTasksLoading = (0, common_1.useLoadingState)();
46
+ var startTasks = (0, hooks_1.useStartTasksOnComplete)({
47
+ inspectionId: inspectionId,
48
+ apiConfig: apiConfig,
49
+ additionalTasks: additionalTasks,
50
+ startTasksOnComplete: startTasksOnComplete,
51
+ loading: startTasksLoading,
52
+ });
53
+ var allowRedirect = (0, common_1.usePreventExit)(true).allowRedirect;
54
+ var handleComplete = function () {
55
+ startTasks()
56
+ .then(function () {
57
+ allowRedirect();
58
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete();
59
+ })
60
+ .catch(function (err) {
61
+ startTasksLoading.onError(err);
62
+ handleError(err);
63
+ });
64
+ };
65
+ var hudProps = {
66
+ inspectionId: inspectionId,
67
+ maxRetryCount: maxRetryCount,
68
+ apiConfig: apiConfig,
69
+ minRecordingDuration: minRecordingDuration,
70
+ enforceOrientation: enforceOrientation,
71
+ isRecording: isRecording,
72
+ setIsRecording: setIsRecording,
73
+ alpha: alpha,
74
+ fastMovementsWarning: fastMovementsWarning,
75
+ onWarningDismiss: onWarningDismiss,
76
+ startTasksLoading: startTasksLoading,
77
+ onComplete: handleComplete,
78
+ };
79
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: VideoCapture_styles_1.styles['container'] }, { children: [screen === VideoCaptureScreen.PERMISSIONS && ((0, jsx_runtime_1.jsx)(VideoCapturePermissions_1.VideoCapturePermissions, { requestCompassPermission: requestCompassPermission, onSuccess: function () { return setScreen(VideoCaptureScreen.CAPTURE); } })), screen === VideoCaptureScreen.CAPTURE && ((0, jsx_runtime_1.jsx)(camera_web_1.Camera, { HUDComponent: VideoCaptureHUD_1.VideoCaptureHUD, hudProps: hudProps }))] })));
80
+ }
81
+ exports.VideoCapture = VideoCapture;
@@ -0,0 +1,9 @@
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
+ };
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { VideoCaptureProps } from './VideoCapture';
3
+ /**
4
+ * The VideoCapture component is a ready-to-use, single page component that implements a Camera app and lets the user
5
+ * record a video of their vehicle in order to add them to an already created Monk inspection. 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`. This component will handle the
8
+ * starting of the tasks at the end of the capturing process. You can then pass the inspection ID, the api config (with
9
+ * the auth token) and everything will be handled automatically for you.
10
+ *
11
+ * @example
12
+ * import { VideoCapture } from '@monkvision/inspection-capture-web';
13
+ *
14
+ * export function VideoCaptureScreen({ inspectionId, apiConfig }: VideoCaptureScreenProps) {
15
+ * const { i18n } = useTranslation();
16
+ *
17
+ * return (
18
+ * <VideoCapture
19
+ * inspectionId={inspectionId}
20
+ * apiConfig={apiConfig}
21
+ * onComplete={() => { / * Navigate to another page * / }}
22
+ * lang={i18n.language}
23
+ * />
24
+ * );
25
+ * }
26
+ */
27
+ export declare const VideoCaptureHOC: import("react").ForwardRefExoticComponent<VideoCaptureProps & 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.VideoCaptureHOC = 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 VideoCapture_1 = require("./VideoCapture");
19
+ /**
20
+ * The VideoCapture component is a ready-to-use, single page component that implements a Camera app and lets the user
21
+ * record a video 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) and everything will be handled automatically for you.
26
+ *
27
+ * @example
28
+ * import { VideoCapture } from '@monkvision/inspection-capture-web';
29
+ *
30
+ * export function VideoCaptureScreen({ inspectionId, apiConfig }: VideoCaptureScreenProps) {
31
+ * const { i18n } = useTranslation();
32
+ *
33
+ * return (
34
+ * <VideoCapture
35
+ * inspectionId={inspectionId}
36
+ * apiConfig={apiConfig}
37
+ * onComplete={() => { / * Navigate to another page * / }}
38
+ * lang={i18n.language}
39
+ * />
40
+ * );
41
+ * }
42
+ */
43
+ exports.VideoCaptureHOC = (0, common_1.i18nWrap)(function VideoCaptureHOC(props) {
44
+ return ((0, jsx_runtime_1.jsx)(common_1.MonkProvider, { children: (0, jsx_runtime_1.jsx)(VideoCapture_1.VideoCapture, __assign({}, props)) }));
45
+ }, i18n_1.i18nInspectionCaptureWeb);
@@ -0,0 +1,44 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { CameraHUDProps } from '@monkvision/camera-web';
3
+ import { MonkApiConfig } from '@monkvision/network';
4
+ import { LoadingState } from '@monkvision/common';
5
+ import { DeviceRotation, VideoCaptureAppConfig } from '@monkvision/types';
6
+ import { FastMovementsDetectionHandle, UseVideoRecordingParams } from '../hooks';
7
+ /**
8
+ * Props accepted by the VideoCaptureHUD component.
9
+ */
10
+ export interface VideoCaptureHUDProps extends CameraHUDProps, Pick<UseVideoRecordingParams, 'minRecordingDuration'>, Pick<VideoCaptureAppConfig, 'enforceOrientation'>, Pick<DeviceRotation, 'alpha'>, Pick<FastMovementsDetectionHandle, 'fastMovementsWarning' | 'onWarningDismiss'> {
11
+ /**
12
+ * The ID of the inspection to add the video frames to.
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 maximum number of retries for failed image uploads.
22
+ */
23
+ maxRetryCount: number;
24
+ /**
25
+ * Boolean indicating if the video is currently recording or not.
26
+ */
27
+ isRecording: boolean;
28
+ /**
29
+ * Callback called when setting the `isRecording` state.
30
+ */
31
+ setIsRecording: Dispatch<SetStateAction<boolean>>;
32
+ /**
33
+ * The loading state for the start task feature.
34
+ */
35
+ startTasksLoading: LoadingState;
36
+ /**
37
+ * Callback called when the inspection capture is complete.
38
+ */
39
+ onComplete?: () => void;
40
+ }
41
+ /**
42
+ * HUD component displayed on top of the camera preview for the VideoCapture process.
43
+ */
44
+ export declare function VideoCaptureHUD({ handle, cameraPreview, inspectionId, apiConfig, isRecording, setIsRecording, enforceOrientation, alpha, fastMovementsWarning, onWarningDismiss, maxRetryCount, minRecordingDuration, startTasksLoading, onComplete, }: VideoCaptureHUDProps): JSX.Element;
@@ -0,0 +1,158 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.VideoCaptureHUD = void 0;
51
+ var jsx_runtime_1 = require("react/jsx-runtime");
52
+ var react_1 = require("react");
53
+ var common_ui_web_1 = require("@monkvision/common-ui-web");
54
+ var react_i18next_1 = require("react-i18next");
55
+ var network_1 = require("@monkvision/network");
56
+ var monitoring_1 = require("@monkvision/monitoring");
57
+ var VideoCaptureHUD_styles_1 = require("./VideoCaptureHUD.styles");
58
+ var VideoCaptureTutorial_1 = require("./VideoCaptureTutorial");
59
+ var VideoCaptureRecording_1 = require("./VideoCaptureRecording");
60
+ var hooks_1 = require("../hooks");
61
+ var VideoCaptureProcessing_1 = require("../VideoCaptureProcessing");
62
+ var components_1 = require("../../components");
63
+ var SCREENSHOT_INTERVAL_MS = 200;
64
+ var FRAME_SELECTION_INTERVAL_MS = 1000;
65
+ var VideoCaptureHUDScreen;
66
+ (function (VideoCaptureHUDScreen) {
67
+ VideoCaptureHUDScreen["TUTORIAL"] = "tutorial";
68
+ VideoCaptureHUDScreen["RECORDING"] = "recording";
69
+ VideoCaptureHUDScreen["PROCESSING"] = "processing";
70
+ })(VideoCaptureHUDScreen || (VideoCaptureHUDScreen = {}));
71
+ function getFastMovementsWarningMessage(type) {
72
+ switch (type) {
73
+ case hooks_1.FastMovementType.WALKING_TOO_FAST:
74
+ return 'video.recording.fastMovementsDialog.walkingTooFast';
75
+ case hooks_1.FastMovementType.PHONE_SHAKING:
76
+ return 'video.recording.fastMovementsDialog.phoneShaking';
77
+ default:
78
+ return '';
79
+ }
80
+ }
81
+ function getTooltipLabel(tooltip) {
82
+ switch (tooltip) {
83
+ case hooks_1.VideoRecordingTooltip.START:
84
+ return 'video.recording.tooltip.start';
85
+ case hooks_1.VideoRecordingTooltip.END:
86
+ return 'video.recording.tooltip.end';
87
+ default:
88
+ return undefined;
89
+ }
90
+ }
91
+ /**
92
+ * HUD component displayed on top of the camera preview for the VideoCapture process.
93
+ */
94
+ function VideoCaptureHUD(_a) {
95
+ var _this = this;
96
+ var handle = _a.handle, cameraPreview = _a.cameraPreview, inspectionId = _a.inspectionId, apiConfig = _a.apiConfig, isRecording = _a.isRecording, setIsRecording = _a.setIsRecording, enforceOrientation = _a.enforceOrientation, alpha = _a.alpha, fastMovementsWarning = _a.fastMovementsWarning, onWarningDismiss = _a.onWarningDismiss, maxRetryCount = _a.maxRetryCount, minRecordingDuration = _a.minRecordingDuration, startTasksLoading = _a.startTasksLoading, onComplete = _a.onComplete;
97
+ var _b = (0, react_1.useState)(VideoCaptureHUDScreen.TUTORIAL), screen = _b[0], setScreen = _b[1];
98
+ var t = (0, react_i18next_1.useTranslation)().t;
99
+ var handleError = (0, monitoring_1.useMonitoring)().handleError;
100
+ var _c = (0, hooks_1.useVehicleWalkaround)({ alpha: alpha }), walkaroundPosition = _c.walkaroundPosition, startWalkaround = _c.startWalkaround;
101
+ var addImage = (0, network_1.useMonkApi)(apiConfig).addImage;
102
+ var _d = (0, hooks_1.useVideoUploadQueue)({
103
+ apiConfig: apiConfig,
104
+ inspectionId: inspectionId,
105
+ maxRetryCount: maxRetryCount,
106
+ }), uploadedFrames = _d.uploadedFrames, totalUploadingFrames = _d.totalUploadingFrames, onFrameSelected = _d.onFrameSelected;
107
+ var _e = (0, hooks_1.useFrameSelection)({
108
+ handle: handle,
109
+ frameSelectionInterval: FRAME_SELECTION_INTERVAL_MS,
110
+ onFrameSelected: onFrameSelected,
111
+ }), processedFrames = _e.processedFrames, totalProcessingFrames = _e.totalProcessingFrames, onCaptureVideoFrame = _e.onCaptureVideoFrame;
112
+ var _f = (0, hooks_1.useVideoRecording)({
113
+ isRecording: isRecording,
114
+ setIsRecording: setIsRecording,
115
+ screenshotInterval: SCREENSHOT_INTERVAL_MS,
116
+ minRecordingDuration: minRecordingDuration,
117
+ enforceOrientation: enforceOrientation,
118
+ walkaroundPosition: walkaroundPosition,
119
+ startWalkaround: startWalkaround,
120
+ onCaptureVideoFrame: onCaptureVideoFrame,
121
+ onRecordingComplete: function () { return setScreen(VideoCaptureHUDScreen.PROCESSING); },
122
+ }), isRecordingPaused = _f.isRecordingPaused, onClickRecordVideo = _f.onClickRecordVideo, onDiscardDialogKeepRecording = _f.onDiscardDialogKeepRecording, onDiscardDialogDiscardVideo = _f.onDiscardDialogDiscardVideo, isDiscardDialogDisplayed = _f.isDiscardDialogDisplayed, recordingDurationMs = _f.recordingDurationMs, pauseRecording = _f.pauseRecording, resumeRecording = _f.resumeRecording, tooltip = _f.tooltip;
123
+ var handleTakePictureClick = function () { return __awaiter(_this, void 0, void 0, function () {
124
+ var picture, err_1;
125
+ return __generator(this, function (_a) {
126
+ switch (_a.label) {
127
+ case 0:
128
+ _a.trys.push([0, 3, , 4]);
129
+ return [4 /*yield*/, handle.takePicture()];
130
+ case 1:
131
+ picture = _a.sent();
132
+ return [4 /*yield*/, addImage({
133
+ uploadType: network_1.ImageUploadType.VIDEO_MANUAL_PHOTO,
134
+ inspectionId: inspectionId,
135
+ picture: picture,
136
+ })];
137
+ case 2:
138
+ _a.sent();
139
+ return [3 /*break*/, 4];
140
+ case 3:
141
+ err_1 = _a.sent();
142
+ handleError(err_1);
143
+ return [3 /*break*/, 4];
144
+ case 4: return [2 /*return*/];
145
+ }
146
+ });
147
+ }); };
148
+ (0, react_1.useEffect)(function () {
149
+ if (fastMovementsWarning) {
150
+ pauseRecording();
151
+ }
152
+ else {
153
+ resumeRecording();
154
+ }
155
+ }, [fastMovementsWarning, pauseRecording, resumeRecording]);
156
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: VideoCaptureHUD_styles_1.styles['container'] }, { children: [cameraPreview, (0, jsx_runtime_1.jsxs)("div", __assign({ style: VideoCaptureHUD_styles_1.styles['hudContainer'] }, { children: [screen === VideoCaptureHUDScreen.TUTORIAL && ((0, jsx_runtime_1.jsx)(VideoCaptureTutorial_1.VideoCaptureTutorial, { onClose: function () { return setScreen(VideoCaptureHUDScreen.RECORDING); } })), screen === VideoCaptureHUDScreen.RECORDING && ((0, jsx_runtime_1.jsx)(VideoCaptureRecording_1.VideoCaptureRecording, { walkaroundPosition: isRecording || isRecordingPaused ? walkaroundPosition : 0, isRecording: isRecording, isRecordingPaused: isRecordingPaused, recordingDurationMs: recordingDurationMs, onClickRecordVideo: onClickRecordVideo, onClickTakePicture: handleTakePictureClick, tooltip: t(getTooltipLabel(tooltip)) })), screen === VideoCaptureHUDScreen.PROCESSING && ((0, jsx_runtime_1.jsx)(VideoCaptureProcessing_1.VideoCaptureProcessing, { inspectionId: inspectionId, processedFrames: processedFrames, totalProcessingFrames: totalProcessingFrames, uploadedFrames: uploadedFrames, totalUploadingFrames: totalUploadingFrames, loading: startTasksLoading, onComplete: onComplete }))] })), (0, jsx_runtime_1.jsx)(common_ui_web_1.BackdropDialog, { show: isDiscardDialogDisplayed, message: t('video.recording.discardDialog.message'), confirmLabel: t('video.recording.discardDialog.keepRecording'), cancelLabel: t('video.recording.discardDialog.discardVideo'), onConfirm: onDiscardDialogKeepRecording, onCancel: onDiscardDialogDiscardVideo }), (0, jsx_runtime_1.jsx)(common_ui_web_1.BackdropDialog, { show: fastMovementsWarning !== null, message: t(getFastMovementsWarningMessage(fastMovementsWarning)), confirmLabel: t('video.recording.fastMovementsDialog.confirm'), onConfirm: onWarningDismiss, showCancelButton: false, dialogIcon: 'warning-outline', dialogIconPrimaryColor: 'caution' }), (0, jsx_runtime_1.jsx)(components_1.OrientationEnforcer, { orientation: enforceOrientation })] })));
157
+ }
158
+ exports.VideoCaptureHUD = VideoCaptureHUD;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.styles = void 0;
4
+ exports.styles = {
5
+ container: {
6
+ width: '100%',
7
+ height: '100%',
8
+ position: 'relative',
9
+ },
10
+ hudContainer: {
11
+ position: 'absolute',
12
+ inset: '0 0 0 0',
13
+ },
14
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { VideoCaptureRecordingProps } from './VideoCaptureRecording.types';
3
+ /**
4
+ * HUD used in recording mode displayed on top of the camera in the VideoCaputre process.
5
+ */
6
+ export declare function VideoCaptureRecording({ walkaroundPosition, isRecording, isRecordingPaused, recordingDurationMs, onClickRecordVideo, onClickTakePicture, tooltip, }: VideoCaptureRecordingProps): JSX.Element;
@@ -0,0 +1,38 @@
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.VideoCaptureRecording = void 0;
15
+ var jsx_runtime_1 = require("react/jsx-runtime");
16
+ var common_ui_web_1 = require("@monkvision/common-ui-web");
17
+ var VideoCaptureRecordingStyles_1 = require("./VideoCaptureRecordingStyles");
18
+ function formatRecordingDuration(durationMs) {
19
+ var totalSeconds = Math.floor(durationMs / 1000);
20
+ var totalMinutes = Math.floor(totalSeconds / 60);
21
+ var remainingSeconds = totalSeconds % 60;
22
+ return "".concat(totalMinutes.toString().padStart(2, '0'), ":").concat(remainingSeconds
23
+ .toString()
24
+ .padStart(2, '0'));
25
+ }
26
+ /**
27
+ * HUD used in recording mode displayed on top of the camera in the VideoCaputre process.
28
+ */
29
+ function VideoCaptureRecording(_a) {
30
+ var walkaroundPosition = _a.walkaroundPosition, isRecording = _a.isRecording, isRecordingPaused = _a.isRecordingPaused, recordingDurationMs = _a.recordingDurationMs, onClickRecordVideo = _a.onClickRecordVideo, onClickTakePicture = _a.onClickTakePicture, tooltip = _a.tooltip;
31
+ var _b = (0, VideoCaptureRecordingStyles_1.useVideoCaptureRecordingStyles)({ isRecording: isRecording }), container = _b.container, indicators = _b.indicators, recordingDuration = _b.recordingDuration, controls = _b.controls, takePictureFlash = _b.takePictureFlash, walkaroundIndicator = _b.walkaroundIndicator, showTakePictureFlash = _b.showTakePictureFlash, tooltipPosition = _b.tooltipPosition;
32
+ var handleTakePictureClick = function () {
33
+ showTakePictureFlash();
34
+ onClickTakePicture === null || onClickTakePicture === void 0 ? void 0 : onClickTakePicture();
35
+ };
36
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: container }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ style: indicators }, { children: (isRecording || isRecordingPaused) && ((0, jsx_runtime_1.jsx)("div", __assign({ style: recordingDuration }, { children: formatRecordingDuration(recordingDurationMs) }))) })), (0, jsx_runtime_1.jsxs)("div", __assign({ style: controls }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ style: walkaroundIndicator, "data-testid": 'walkaround-indicator-container' }, { children: (0, jsx_runtime_1.jsx)(common_ui_web_1.VehicleWalkaroundIndicator, { alpha: walkaroundPosition }) })), (0, jsx_runtime_1.jsx)(common_ui_web_1.RecordVideoButton, { isRecording: isRecording, onClick: onClickRecordVideo, tooltip: tooltip, tooltipPosition: tooltipPosition }), (0, jsx_runtime_1.jsx)(common_ui_web_1.TakePictureButton, { onClick: handleTakePictureClick, disabled: !isRecording })] })), (0, jsx_runtime_1.jsx)("div", { style: takePictureFlash })] })));
37
+ }
38
+ exports.VideoCaptureRecording = VideoCaptureRecording;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Props accepted by the VideoCaptureRecording component.
3
+ */
4
+ export interface VideoCaptureRecordingProps {
5
+ /**
6
+ * The rotation of the user aroundn the vehicle in deg.
7
+ */
8
+ walkaroundPosition: number;
9
+ /**
10
+ * Boolean indicating if the video is currently recording or not.
11
+ */
12
+ isRecording: boolean;
13
+ /**
14
+ * Boolean indicating if the video recording is paused or not.
15
+ */
16
+ isRecordingPaused: boolean;
17
+ /**
18
+ * The total duration (in milliseconds) of the current video recording.
19
+ */
20
+ recordingDurationMs: number;
21
+ /**
22
+ * Callback called when the user clicks on the record video button.
23
+ */
24
+ onClickRecordVideo?: () => void;
25
+ /**
26
+ * Callback called when the user clicks on the take picture button.
27
+ */
28
+ onClickTakePicture?: () => void;
29
+ /**
30
+ * The tooltip to display on top of the recording button.
31
+ */
32
+ tooltip?: string;
33
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });