@ovok/native 1.5.5 → 1.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 (656) hide show
  1. package/README.md +27 -17
  2. package/app.plugin.js +104 -0
  3. package/lib/commonjs/index.js +11 -0
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  6. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  7. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js +23 -0
  8. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  9. package/lib/commonjs/modules/auth/hooks/use-session.js +91 -0
  10. package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -0
  11. package/lib/commonjs/modules/auth/index.js +44 -0
  12. package/lib/commonjs/modules/auth/index.js.map +1 -1
  13. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js +3 -1
  14. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js.map +1 -1
  15. package/lib/commonjs/modules/auth/register/components/form/inputs.js +48 -1
  16. package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
  17. package/lib/commonjs/modules/auth/register/components/form/register-button.js +4 -0
  18. package/lib/commonjs/modules/auth/register/components/form/register-button.js.map +1 -1
  19. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +6 -0
  20. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  21. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js +12 -0
  22. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  23. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  24. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  25. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  26. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  27. package/lib/commonjs/modules/auth/session/components/session-list.js +82 -0
  28. package/lib/commonjs/modules/auth/session/components/session-list.js.map +1 -0
  29. package/lib/commonjs/modules/auth/session/events.js +19 -0
  30. package/lib/commonjs/modules/auth/session/events.js.map +1 -0
  31. package/lib/commonjs/modules/auth/session/index.js +13 -0
  32. package/lib/commonjs/modules/auth/session/index.js.map +1 -0
  33. package/lib/commonjs/modules/auth/session/types/session-list-props.js +6 -0
  34. package/lib/commonjs/modules/auth/session/types/session-list-props.js.map +1 -0
  35. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js +25 -0
  36. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  37. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  38. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  39. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js +58 -0
  40. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  41. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  42. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  43. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js +13 -5
  44. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  45. package/lib/commonjs/modules/auth/types/session.js +2 -0
  46. package/lib/commonjs/modules/auth/types/session.js.map +1 -0
  47. package/lib/commonjs/modules/auth/utils/rate-limit.js +37 -0
  48. package/lib/commonjs/modules/auth/utils/rate-limit.js.map +1 -0
  49. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  50. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  51. package/lib/commonjs/modules/background-sync/background-safe-storage.js +79 -0
  52. package/lib/commonjs/modules/background-sync/background-safe-storage.js.map +1 -0
  53. package/lib/commonjs/modules/background-sync/index.js +11 -0
  54. package/lib/commonjs/modules/background-sync/index.js.map +1 -1
  55. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +123 -21
  56. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  57. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +91 -0
  58. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -0
  59. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js +47 -0
  60. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  61. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js +51 -0
  62. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  63. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js +36 -0
  64. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  65. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js +46 -0
  66. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js.map +1 -0
  67. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +57 -0
  68. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -0
  69. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js +26 -0
  70. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  71. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js +49 -0
  72. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  73. package/lib/commonjs/modules/bt-management/index.js +143 -0
  74. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  75. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -4
  76. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  77. package/lib/commonjs/modules/bt-management/services/bt-manager.js +75 -4
  78. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  79. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +57 -0
  80. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  81. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +111 -3
  82. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  83. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  84. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  85. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  86. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  87. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.js +9 -3
  88. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.js.map +1 -1
  89. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +52 -0
  90. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  91. package/lib/commonjs/modules/bt-management/testing/index.js +28 -0
  92. package/lib/commonjs/modules/bt-management/testing/index.js.map +1 -0
  93. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js +23 -0
  94. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js.map +1 -0
  95. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js +80 -0
  96. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js.map +1 -0
  97. package/lib/commonjs/modules/bt-management/types/device-connection-event.js +6 -0
  98. package/lib/commonjs/modules/bt-management/types/device-connection-event.js.map +1 -0
  99. package/lib/commonjs/modules/bt-management/types/result-policy.js +6 -0
  100. package/lib/commonjs/modules/bt-management/types/result-policy.js.map +1 -0
  101. package/lib/commonjs/modules/bt-management/utils/result-identity.js +63 -0
  102. package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -0
  103. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js +8 -2
  104. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  105. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +23 -4
  106. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  107. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +2 -2
  108. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
  109. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  110. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  111. package/lib/commonjs/modules/data-sync/utils/retry-save.js +65 -0
  112. package/lib/commonjs/modules/data-sync/utils/retry-save.js.map +1 -0
  113. package/lib/commonjs/modules/helpers/form-items/form-field.js +2 -0
  114. package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
  115. package/lib/commonjs/modules/helpers/index.js +12 -0
  116. package/lib/commonjs/modules/helpers/index.js.map +1 -1
  117. package/lib/commonjs/modules/helpers/utils/s-log.js +4 -13
  118. package/lib/commonjs/modules/helpers/utils/s-log.js.map +1 -1
  119. package/lib/commonjs/modules/helpers/utils/sentry-logger.js +28 -17
  120. package/lib/commonjs/modules/helpers/utils/sentry-logger.js.map +1 -1
  121. package/lib/commonjs/modules/helpers/utils/telemetry.js +143 -0
  122. package/lib/commonjs/modules/helpers/utils/telemetry.js.map +1 -0
  123. package/lib/commonjs/modules/image/components/optimized-image.js +24 -2
  124. package/lib/commonjs/modules/image/components/optimized-image.js.map +1 -1
  125. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +18 -9
  126. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  127. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  128. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  129. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  130. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  131. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +42 -17
  132. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  133. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  134. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  135. package/lib/commonjs/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  136. package/lib/commonjs/modules/tile/components/task-icon.js +2 -1
  137. package/lib/commonjs/modules/tile/components/task-icon.js.map +1 -1
  138. package/lib/commonjs/modules/ui/components/background-sync-setting.js +113 -0
  139. package/lib/commonjs/modules/ui/components/background-sync-setting.js.map +1 -0
  140. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +105 -0
  141. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  142. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js +165 -0
  143. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  144. package/lib/commonjs/modules/ui/components/health-import-card.js +130 -0
  145. package/lib/commonjs/modules/ui/components/health-import-card.js.map +1 -0
  146. package/lib/commonjs/modules/ui/components/manual-entry-form.js +123 -0
  147. package/lib/commonjs/modules/ui/components/manual-entry-form.js.map +1 -0
  148. package/lib/commonjs/modules/ui/components/pairing-flow.js +222 -0
  149. package/lib/commonjs/modules/ui/components/pairing-flow.js.map +1 -0
  150. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js +99 -0
  151. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  152. package/lib/commonjs/modules/ui/components/urine-test-result.js +94 -0
  153. package/lib/commonjs/modules/ui/components/urine-test-result.js.map +1 -0
  154. package/lib/commonjs/modules/ui/index.js +116 -0
  155. package/lib/commonjs/modules/ui/index.js.map +1 -0
  156. package/lib/commonjs/modules/ui/types.js +6 -0
  157. package/lib/commonjs/modules/ui/types.js.map +1 -0
  158. package/lib/commonjs/modules/ui/use-ovok-ui.js +51 -0
  159. package/lib/commonjs/modules/ui/use-ovok-ui.js.map +1 -0
  160. package/lib/module/index.js +1 -0
  161. package/lib/module/index.js.map +1 -1
  162. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  163. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  164. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js +17 -0
  165. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  166. package/lib/module/modules/auth/hooks/use-session.js +85 -0
  167. package/lib/module/modules/auth/hooks/use-session.js.map +1 -0
  168. package/lib/module/modules/auth/index.js +4 -0
  169. package/lib/module/modules/auth/index.js.map +1 -1
  170. package/lib/module/modules/auth/logout-button/components/logout-button.js +3 -1
  171. package/lib/module/modules/auth/logout-button/components/logout-button.js.map +1 -1
  172. package/lib/module/modules/auth/register/components/form/inputs.js +48 -1
  173. package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
  174. package/lib/module/modules/auth/register/components/form/register-button.js +4 -0
  175. package/lib/module/modules/auth/register/components/form/register-button.js.map +1 -1
  176. package/lib/module/modules/auth/register/components/form/register-form-provider.js +6 -0
  177. package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  178. package/lib/module/modules/auth/reset-password/components/form/inputs.js +12 -0
  179. package/lib/module/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  180. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  181. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  182. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  183. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  184. package/lib/module/modules/auth/session/components/session-list.js +76 -0
  185. package/lib/module/modules/auth/session/components/session-list.js.map +1 -0
  186. package/lib/module/modules/auth/session/events.js +13 -0
  187. package/lib/module/modules/auth/session/events.js.map +1 -0
  188. package/lib/module/modules/auth/session/index.js +4 -0
  189. package/lib/module/modules/auth/session/index.js.map +1 -0
  190. package/lib/module/modules/auth/session/types/session-list-props.js +4 -0
  191. package/lib/module/modules/auth/session/types/session-list-props.js.map +1 -0
  192. package/lib/module/modules/auth/sign-in/components/form/inputs.js +25 -0
  193. package/lib/module/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  194. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  195. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  196. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js +52 -0
  197. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  198. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  199. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  200. package/lib/module/modules/auth/sign-in/components/form/signin-button.js +13 -5
  201. package/lib/module/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  202. package/lib/module/modules/auth/types/session.js +2 -0
  203. package/lib/module/modules/auth/types/session.js.map +1 -0
  204. package/lib/module/modules/auth/utils/rate-limit.js +31 -0
  205. package/lib/module/modules/auth/utils/rate-limit.js.map +1 -0
  206. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  207. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  208. package/lib/module/modules/background-sync/background-safe-storage.js +74 -0
  209. package/lib/module/modules/background-sync/background-safe-storage.js.map +1 -0
  210. package/lib/module/modules/background-sync/index.js +1 -0
  211. package/lib/module/modules/background-sync/index.js.map +1 -1
  212. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +123 -21
  213. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  214. package/lib/module/modules/bt-management/hooks/runtime-context.js +82 -0
  215. package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -0
  216. package/lib/module/modules/bt-management/hooks/use-background-sync.js +41 -0
  217. package/lib/module/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  218. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js +45 -0
  219. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  220. package/lib/module/modules/bt-management/hooks/use-device-connection.js +30 -0
  221. package/lib/module/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  222. package/lib/module/modules/bt-management/hooks/use-health-import.js +40 -0
  223. package/lib/module/modules/bt-management/hooks/use-health-import.js.map +1 -0
  224. package/lib/module/modules/bt-management/hooks/use-measurements.js +51 -0
  225. package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -0
  226. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js +20 -0
  227. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  228. package/lib/module/modules/bt-management/hooks/use-paired-devices.js +43 -0
  229. package/lib/module/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  230. package/lib/module/modules/bt-management/index.js +13 -0
  231. package/lib/module/modules/bt-management/index.js.map +1 -1
  232. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -4
  233. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  234. package/lib/module/modules/bt-management/services/bt-manager.js +75 -4
  235. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  236. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +57 -0
  237. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  238. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +111 -3
  239. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  240. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  241. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  242. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  243. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  244. package/lib/module/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.js +9 -3
  245. package/lib/module/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.js.map +1 -1
  246. package/lib/module/modules/bt-management/testing/fake-ble-manager.js +48 -0
  247. package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  248. package/lib/module/modules/bt-management/testing/index.js +5 -0
  249. package/lib/module/modules/bt-management/testing/index.js.map +1 -0
  250. package/lib/module/modules/bt-management/testing/recorded-frames.js +17 -0
  251. package/lib/module/modules/bt-management/testing/recorded-frames.js.map +1 -0
  252. package/lib/module/modules/bt-management/types/bluetooth-error.js +74 -0
  253. package/lib/module/modules/bt-management/types/bluetooth-error.js.map +1 -0
  254. package/lib/module/modules/bt-management/types/device-connection-event.js +4 -0
  255. package/lib/module/modules/bt-management/types/device-connection-event.js.map +1 -0
  256. package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
  257. package/lib/module/modules/bt-management/types/result-policy.js +4 -0
  258. package/lib/module/modules/bt-management/types/result-policy.js.map +1 -0
  259. package/lib/module/modules/bt-management/utils/result-identity.js +57 -0
  260. package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -0
  261. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js +8 -2
  262. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  263. package/lib/module/modules/data-sync/services/base-health-sync-service.js +23 -4
  264. package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  265. package/lib/module/modules/data-sync/services/managers/data-processor.js +2 -2
  266. package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
  267. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  268. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  269. package/lib/module/modules/data-sync/utils/retry-save.js +60 -0
  270. package/lib/module/modules/data-sync/utils/retry-save.js.map +1 -0
  271. package/lib/module/modules/helpers/form-items/form-field.js +2 -0
  272. package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
  273. package/lib/module/modules/helpers/index.js +1 -0
  274. package/lib/module/modules/helpers/index.js.map +1 -1
  275. package/lib/module/modules/helpers/utils/s-log.js +4 -12
  276. package/lib/module/modules/helpers/utils/s-log.js.map +1 -1
  277. package/lib/module/modules/helpers/utils/sentry-logger.js +26 -14
  278. package/lib/module/modules/helpers/utils/sentry-logger.js.map +1 -1
  279. package/lib/module/modules/helpers/utils/telemetry.js +131 -0
  280. package/lib/module/modules/helpers/utils/telemetry.js.map +1 -0
  281. package/lib/module/modules/image/components/optimized-image.js +25 -3
  282. package/lib/module/modules/image/components/optimized-image.js.map +1 -1
  283. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +20 -11
  284. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  285. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  286. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  287. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  288. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  289. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +42 -17
  290. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  291. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  292. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  293. package/lib/module/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  294. package/lib/module/modules/tile/components/task-icon.js +2 -1
  295. package/lib/module/modules/tile/components/task-icon.js.map +1 -1
  296. package/lib/module/modules/ui/components/background-sync-setting.js +107 -0
  297. package/lib/module/modules/ui/components/background-sync-setting.js.map +1 -0
  298. package/lib/module/modules/ui/components/bluetooth-state-notice.js +99 -0
  299. package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  300. package/lib/module/modules/ui/components/ecg-strip-viewer.js +159 -0
  301. package/lib/module/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  302. package/lib/module/modules/ui/components/health-import-card.js +124 -0
  303. package/lib/module/modules/ui/components/health-import-card.js.map +1 -0
  304. package/lib/module/modules/ui/components/manual-entry-form.js +117 -0
  305. package/lib/module/modules/ui/components/manual-entry-form.js.map +1 -0
  306. package/lib/module/modules/ui/components/pairing-flow.js +216 -0
  307. package/lib/module/modules/ui/components/pairing-flow.js.map +1 -0
  308. package/lib/module/modules/ui/components/supported-devices-catalog-list.js +93 -0
  309. package/lib/module/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  310. package/lib/module/modules/ui/components/urine-test-result.js +89 -0
  311. package/lib/module/modules/ui/components/urine-test-result.js.map +1 -0
  312. package/lib/module/modules/ui/index.js +13 -0
  313. package/lib/module/modules/ui/index.js.map +1 -0
  314. package/lib/module/modules/ui/types.js +4 -0
  315. package/lib/module/modules/ui/types.js.map +1 -0
  316. package/lib/module/modules/ui/use-ovok-ui.js +45 -0
  317. package/lib/module/modules/ui/use-ovok-ui.js.map +1 -0
  318. package/lib/typescript/commonjs/src/index.d.ts +1 -0
  319. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  320. package/lib/typescript/commonjs/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  322. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  323. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +16 -0
  324. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  325. package/lib/typescript/commonjs/src/modules/auth/index.d.ts +4 -0
  326. package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
  327. package/lib/typescript/commonjs/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  328. package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  329. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  330. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  331. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  333. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  334. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts +4 -0
  335. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  336. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts +5 -0
  337. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts.map +1 -0
  338. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts +3 -0
  339. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts.map +1 -0
  340. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  341. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  342. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  343. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  345. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  346. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  347. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  348. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  350. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  351. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  352. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  353. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  354. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  356. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts +13 -0
  358. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts +11 -0
  360. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  362. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts +29 -0
  363. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  364. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts +1 -0
  365. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts.map +1 -1
  366. package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  367. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +46 -0
  368. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  369. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  370. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  371. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  372. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  373. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  374. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  375. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  376. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  377. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  378. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  379. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  380. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  381. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  382. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  383. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +13 -0
  384. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  385. package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  386. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  387. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  388. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  389. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  390. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +9 -1
  391. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  392. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  393. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  394. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  395. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.d.ts +2 -0
  396. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.d.ts.map +1 -1
  397. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts +16 -0
  398. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  399. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts +3 -0
  400. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts.map +1 -0
  401. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  402. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +3 -1
  404. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  405. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  406. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  407. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  408. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  409. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  410. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  411. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  412. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  413. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  414. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  415. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts +5 -2
  416. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  417. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  418. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  419. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
  420. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  421. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +8 -0
  422. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  423. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  424. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  425. package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  426. package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  427. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  428. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  429. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  430. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  431. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  432. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  433. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  434. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts +5 -0
  435. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  436. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts +4 -1
  437. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  438. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts +1 -0
  439. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts.map +1 -1
  440. package/lib/typescript/commonjs/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  441. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  442. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  443. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts +68 -0
  444. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  445. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts +1 -1
  446. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts.map +1 -1
  447. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts +4 -0
  448. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  449. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  450. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  451. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  452. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  454. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  455. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  456. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  457. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  458. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  459. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  460. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  461. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  462. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  463. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  464. package/lib/typescript/commonjs/src/modules/tile/components/task-icon.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  466. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  467. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  468. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  469. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  470. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  471. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts +13 -0
  472. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  473. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts +20 -0
  474. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  475. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts +15 -0
  476. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  477. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  478. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  479. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts +10 -0
  480. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  481. package/lib/typescript/commonjs/src/modules/ui/index.d.ts +11 -0
  482. package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -0
  483. package/lib/typescript/commonjs/src/modules/ui/types.d.ts +24 -0
  484. package/lib/typescript/commonjs/src/modules/ui/types.d.ts.map +1 -0
  485. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts +7 -0
  486. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  487. package/lib/typescript/module/src/index.d.ts +1 -0
  488. package/lib/typescript/module/src/index.d.ts.map +1 -1
  489. package/lib/typescript/module/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  490. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  491. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  492. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +16 -0
  493. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  494. package/lib/typescript/module/src/modules/auth/index.d.ts +4 -0
  495. package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
  496. package/lib/typescript/module/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  497. package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  498. package/lib/typescript/module/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  499. package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  500. package/lib/typescript/module/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  501. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  502. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  503. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts +4 -0
  504. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  505. package/lib/typescript/module/src/modules/auth/session/events.d.ts +5 -0
  506. package/lib/typescript/module/src/modules/auth/session/events.d.ts.map +1 -0
  507. package/lib/typescript/module/src/modules/auth/session/index.d.ts +3 -0
  508. package/lib/typescript/module/src/modules/auth/session/index.d.ts.map +1 -0
  509. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  510. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  511. package/lib/typescript/module/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  512. package/lib/typescript/module/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  513. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  514. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  515. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  516. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  517. package/lib/typescript/module/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  518. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  519. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  520. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  521. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  522. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  523. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  524. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  525. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  526. package/lib/typescript/module/src/modules/auth/types/session.d.ts +13 -0
  527. package/lib/typescript/module/src/modules/auth/types/session.d.ts.map +1 -0
  528. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts +11 -0
  529. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  530. package/lib/typescript/module/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  531. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts +29 -0
  532. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  533. package/lib/typescript/module/src/modules/background-sync/index.d.ts +1 -0
  534. package/lib/typescript/module/src/modules/background-sync/index.d.ts.map +1 -1
  535. package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  536. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +46 -0
  537. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  538. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  539. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  540. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  541. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  542. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  543. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  544. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  545. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  546. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  547. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  548. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  549. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  550. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  551. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  552. package/lib/typescript/module/src/modules/bt-management/index.d.ts +13 -0
  553. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  554. package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  555. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  556. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  557. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  558. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  559. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +9 -1
  560. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  561. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  562. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  563. package/lib/typescript/module/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  564. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.d.ts +2 -0
  565. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval-activity-sequencer.d.ts.map +1 -1
  566. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts +16 -0
  567. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  568. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts +3 -0
  569. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts.map +1 -0
  570. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  571. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  572. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +3 -1
  573. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  574. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  575. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  576. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  577. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  578. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  579. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  580. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  581. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  582. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  583. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  584. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts +5 -2
  585. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  586. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  587. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  588. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
  589. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  590. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +8 -0
  591. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  592. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  593. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  594. package/lib/typescript/module/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  595. package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  596. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  597. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  598. package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  599. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  600. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  601. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  602. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  603. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts +5 -0
  604. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  605. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts +4 -1
  606. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  607. package/lib/typescript/module/src/modules/helpers/index.d.ts +1 -0
  608. package/lib/typescript/module/src/modules/helpers/index.d.ts.map +1 -1
  609. package/lib/typescript/module/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  610. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  611. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  612. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts +68 -0
  613. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  614. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts +1 -1
  615. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts.map +1 -1
  616. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts +4 -0
  617. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  618. package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  619. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  620. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  621. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  622. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  623. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  624. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  625. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  626. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  627. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  628. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  629. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  630. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  631. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  632. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  633. package/lib/typescript/module/src/modules/tile/components/task-icon.d.ts.map +1 -1
  634. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  635. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  636. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  637. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  638. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  639. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  640. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts +13 -0
  641. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  642. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts +20 -0
  643. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  644. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts +15 -0
  645. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  646. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  647. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  648. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts +10 -0
  649. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  650. package/lib/typescript/module/src/modules/ui/index.d.ts +11 -0
  651. package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -0
  652. package/lib/typescript/module/src/modules/ui/types.d.ts +24 -0
  653. package/lib/typescript/module/src/modules/ui/types.d.ts.map +1 -0
  654. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts +7 -0
  655. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  656. package/package.json +145 -6
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { Platform, StyleSheet, View } from "react-native";
5
+ import { ActivityIndicator, Card as PaperCard, Switch, Text as PaperText } from "react-native-paper";
6
+ import { useBackgroundSync } from "../../bt-management/index.js";
7
+ import { useOvokUi } from "../use-ovok-ui.js";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ const platformDescription = Platform.select({
10
+ ios: "Keeps Bluetooth work available when iOS allows background refresh. Battery use may increase.",
11
+ android: "Keeps Bluetooth work available in the background. Android may require nearby-device and battery permissions.",
12
+ default: "Keeps Bluetooth work available while the app is in the background."
13
+ });
14
+ export const BackgroundSyncSetting = ({
15
+ title = "Background sync",
16
+ testID,
17
+ theme: themeOverride,
18
+ slots,
19
+ enabled: initialEnabled,
20
+ canEnable,
21
+ onEnabledChange
22
+ }) => {
23
+ const {
24
+ theme,
25
+ slots: resolvedSlots
26
+ } = useOvokUi({
27
+ theme: themeOverride,
28
+ slots
29
+ });
30
+ const Card = resolvedSlots.Card ?? PaperCard;
31
+ const Text = resolvedSlots.Text ?? PaperText;
32
+ const {
33
+ enabled,
34
+ setEnabled,
35
+ status,
36
+ reason,
37
+ error
38
+ } = useBackgroundSync({
39
+ enabled: initialEnabled,
40
+ canEnable,
41
+ onEnabledChange
42
+ });
43
+ const [busy, setBusy] = React.useState(false);
44
+ const toggle = async next => {
45
+ setBusy(true);
46
+ try {
47
+ await setEnabled(next);
48
+ } finally {
49
+ setBusy(false);
50
+ }
51
+ };
52
+ const statusText = status === "on" ? "On" : status === "restricted" ? "Restricted" : status === "blocked" ? "Blocked" : "Off";
53
+ return /*#__PURE__*/_jsx(Card, {
54
+ testID: testID,
55
+ style: {
56
+ borderRadius: theme.borderRadius(2)
57
+ },
58
+ children: /*#__PURE__*/_jsxs(View, {
59
+ style: styles.content,
60
+ children: [/*#__PURE__*/_jsxs(View, {
61
+ style: styles.header,
62
+ children: [/*#__PURE__*/_jsxs(View, {
63
+ style: styles.grow,
64
+ children: [/*#__PURE__*/_jsx(Text, {
65
+ variant: "titleMedium",
66
+ children: title
67
+ }), /*#__PURE__*/_jsx(Text, {
68
+ children: statusText
69
+ })]
70
+ }), busy ? /*#__PURE__*/_jsx(ActivityIndicator, {}) : /*#__PURE__*/_jsx(Switch, {
71
+ value: enabled,
72
+ onValueChange: value => void toggle(value)
73
+ })]
74
+ }), /*#__PURE__*/_jsx(Text, {
75
+ style: {
76
+ color: theme.colors.onSurfaceVariant
77
+ },
78
+ children: platformDescription
79
+ }), reason && /*#__PURE__*/_jsx(Text, {
80
+ style: {
81
+ color: theme.colors.error
82
+ },
83
+ children: reason
84
+ }), error && /*#__PURE__*/_jsx(Text, {
85
+ style: {
86
+ color: theme.colors.error
87
+ },
88
+ children: error.message
89
+ })]
90
+ })
91
+ });
92
+ };
93
+ const styles = StyleSheet.create({
94
+ content: {
95
+ padding: 16
96
+ },
97
+ header: {
98
+ alignItems: "center",
99
+ flexDirection: "row",
100
+ gap: 8,
101
+ paddingBottom: 8
102
+ },
103
+ grow: {
104
+ flex: 1
105
+ }
106
+ });
107
+ //# sourceMappingURL=background-sync-setting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Platform","StyleSheet","View","ActivityIndicator","Card","PaperCard","Switch","Text","PaperText","useBackgroundSync","useOvokUi","jsx","_jsx","jsxs","_jsxs","platformDescription","select","ios","android","default","BackgroundSyncSetting","title","testID","theme","themeOverride","slots","enabled","initialEnabled","canEnable","onEnabledChange","resolvedSlots","setEnabled","status","reason","error","busy","setBusy","useState","toggle","next","statusText","style","borderRadius","children","styles","content","header","grow","variant","value","onValueChange","color","colors","onSurfaceVariant","message","create","padding","alignItems","flexDirection","gap","paddingBottom","flex"],"sour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EAAE5B;MAAmB,CAAO,CAAC,EAClFkB,MAAM,iBAAIrB,IAAA,CAACL,IAAI;QAACkC,KAAK,EAAE;UAAEU,KAAK,EAAE5B,KAAK,CAAC6B,MAAM,CAAClB;QAAM,CAAE;QAAAS,QAAA,EAAEV;MAAM,CAAO,CAAC,EACrEC,KAAK,iBAAItB,IAAA,CAACL,IAAI;QAACkC,KAAK,EAAE;UAAEU,KAAK,EAAE5B,KAAK,CAAC6B,MAAM,CAAClB;QAAM,CAAE;QAAAS,QAAA,EAAET,KAAK,CAACoB;MAAO,CAAO,CAAC;IAAA,CACxE;EAAC,CACH,CAAC;AAEX,CAAC;AAED,MAAMV,MAAM,GAAG3C,UAAU,CAACsD,MAAM,CAAC;EAC/BV,OAAO,EAAE;IAAEW,OAAO,EAAE;EAAG,CAAC;EACxBV,MAAM,EAAE;IAAEW,UAAU,EAAE,QAAQ;IAAEC,aAAa,EAAE,KAAK;IAAEC,GAAG,EAAE,CAAC;IAAEC,aAAa,EAAE;EAAE,CAAC;EAChFb,IAAI,EAAE;IAAEc,IAAI,EAAE;EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { Linking, Platform, StyleSheet, View } from "react-native";
5
+ import { Button as PaperButton, Card as PaperCard, Text as PaperText } from "react-native-paper";
6
+ import { useBluetoothState } from "../../bt-management/index.js";
7
+ import { useOvokUi } from "../use-ovok-ui.js";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ export const BluetoothStateNotice = ({
10
+ bleManager,
11
+ requestPermission,
12
+ onOpenSettings,
13
+ title,
14
+ testID,
15
+ ...uiProps
16
+ }) => {
17
+ const {
18
+ theme,
19
+ slots
20
+ } = useOvokUi(uiProps);
21
+ const Button = slots.Button ?? PaperButton;
22
+ const Card = slots.Card ?? PaperCard;
23
+ const Text = slots.Text ?? PaperText;
24
+ const {
25
+ state,
26
+ requestPermission: request
27
+ } = useBluetoothState({
28
+ bleManager,
29
+ requestPermission
30
+ });
31
+ const [busy, setBusy] = React.useState(false);
32
+ if (state === "on") {
33
+ return null;
34
+ }
35
+ const openSettings = async () => {
36
+ if (onOpenSettings) {
37
+ await onOpenSettings();
38
+ return;
39
+ }
40
+ await Linking.openSettings();
41
+ };
42
+ const takeAction = async () => {
43
+ setBusy(true);
44
+ try {
45
+ if (state === "unauthorized") {
46
+ const granted = await request();
47
+ if (granted) {
48
+ return;
49
+ }
50
+ }
51
+ if (state === "off") {
52
+ await openSettings();
53
+ }
54
+ } finally {
55
+ setBusy(false);
56
+ }
57
+ };
58
+ const copy = state === "unsupported" ? {
59
+ heading: title ?? "Bluetooth is not supported",
60
+ body: "This device cannot use Bluetooth Low Energy.",
61
+ action: undefined
62
+ } : state === "unauthorized" ? {
63
+ heading: title ?? "Bluetooth permission is required",
64
+ body: Platform.OS === "android" ? "Allow Nearby devices permission to find health devices." : "Allow Bluetooth access to find health devices.",
65
+ action: "Allow access"
66
+ } : {
67
+ heading: title ?? "Bluetooth is off",
68
+ body: "Turn on Bluetooth to find and connect to health devices.",
69
+ action: "Open Bluetooth settings"
70
+ };
71
+ return /*#__PURE__*/_jsx(Card, {
72
+ testID: testID,
73
+ style: {
74
+ borderRadius: theme.borderRadius(2)
75
+ },
76
+ children: /*#__PURE__*/_jsxs(View, {
77
+ style: styles.content,
78
+ children: [/*#__PURE__*/_jsx(Text, {
79
+ variant: "titleMedium",
80
+ children: copy.heading
81
+ }), /*#__PURE__*/_jsx(Text, {
82
+ children: copy.body
83
+ }), copy.action && /*#__PURE__*/_jsx(Button, {
84
+ loading: busy,
85
+ disabled: busy,
86
+ mode: "contained",
87
+ onPress: () => void takeAction(),
88
+ children: copy.action
89
+ })]
90
+ })
91
+ });
92
+ };
93
+ const styles = StyleSheet.create({
94
+ content: {
95
+ gap: 10,
96
+ padding: 16
97
+ }
98
+ });
99
+ //# sourceMappingURL=bluetooth-state-notice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Linking","Platform","StyleSheet","View","Button","PaperButton","Card","PaperCard","Text","PaperText","useBluetoothState","useOvokUi","jsx","_jsx","jsxs","_jsxs","BluetoothStateNotice","bleManager","requestPermission","onOpenSettings","title","testID","uiProps","theme","slots","state","request","busy","setBusy","useState","openSettings","takeAction","granted","copy","heading","body","action","undefined","OS","style","borderRadius","children","styles","content","variant","loading","disabled","mode","onPress","create","gap","padding"],"sourceRoot":"../../../../../src","sources":["modules/ui/components/bluetooth-state-notice.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,OAAO,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAElE,SACEC,MAAM,IAAIC,WAAW,EACrBC,IAAI,IAAIC,SAAS,EACjBC,IAAI,IAAIC,SAAS,QACZ,oBAAoB;AAE3B,SAASC,iBAAiB,QAAQ,8BAAqB;AAEvD,SAASC,SAAS,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU3C,OAAO,MAAMC,oBAAoB,GAAGA,CAAC;EACnCC,UAAU;EACVC,iBAAiB;EACjBC,cAAc;EACdC,KAAK;EACLC,MAAM;EACN,GAAGC;AACsB,CAAC,KAAK;EAC/B,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGb,SAAS,CAACW,OAAO,CAAC;EAC3C,MAAMlB,MAAM,GAAGoB,KAAK,CAACpB,MAAM,IAAIC,WAAW;EAC1C,MAAMC,IAAI,GAAGkB,KAAK,CAAClB,IAAI,IAAIC,SAAS;EACpC,MAAMC,IAAI,GAAGgB,KAAK,CAAChB,IAAI,IAAIC,SAAS;EACpC,MAAM;IAAEgB,KAAK;IAAEP,iBAAiB,EAAEQ;EAAQ,CAAC,GAAGhB,iBAAiB,CAAC;IAAEO,UAAU;IAAEC;EAAkB,CAAC,CAAC;EAClG,MAAM,CAACS,IAAI,EAAEC,OA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IAAAC,QAAA,eACnE1B,KAAA,CAACZ,IAAI;MAACoC,KAAK,EAAEG,MAAM,CAACC,OAAQ;MAAAF,QAAA,gBAC1B5B,IAAA,CAACL,IAAI;QAACoC,OAAO,EAAC,aAAa;QAAAH,QAAA,EAAER,IAAI,CAACC;MAAO,CAAO,CAAC,eACjDrB,IAAA,CAACL,IAAI;QAAAiC,QAAA,EAAER,IAAI,CAACE;MAAI,CAAO,CAAC,EACvBF,IAAI,CAACG,MAAM,iBACVvB,IAAA,CAACT,MAAM;QAACyC,OAAO,EAAElB,IAAK;QAACmB,QAAQ,EAAEnB,IAAK;QAACoB,IAAI,EAAC,WAAW;QAACC,OAAO,EAAEA,CAAA,KAAM,KAAKjB,UAAU,CAAC,CAAE;QAAAU,QAAA,EACtFR,IAAI,CAACG;MAAM,CACN,CACT;IAAA,CACG;EAAC,CACH,CAAC;AAEX,CAAC;AAED,MAAMM,MAAM,GAAGxC,UAAU,CAAC+C,MAAM,CAAC;EAAEN,OAAO,EAAE;IAAEO,GAAG,EAAE,EAAE;IAAEC,OAAO,EAAE;EAAG;AAAE,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { Pressable, ScrollView, StyleSheet, View } from "react-native";
5
+ import Svg, { Path, Line } from "react-native-svg";
6
+ import { useOvokUi } from "../use-ovok-ui.js";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const MILLIMETRE = 4;
9
+ const DEFAULT_PAGE_DURATION = 30;
10
+ const DEFAULT_SPEED = 25;
11
+ const DEFAULT_GAIN = 10;
12
+ const STRIP_HEIGHT = 200;
13
+ const MAX_PATH_POINTS = 5000;
14
+ const range = count => Array.from({
15
+ length: Math.max(0, count)
16
+ }, (_, index) => index);
17
+ const buildTracePath = (samples, sampleRate, speed, gain, width) => {
18
+ if (!samples.length || sampleRate <= 0) {
19
+ return "";
20
+ }
21
+ const stride = Math.max(1, Math.ceil(samples.length / MAX_PATH_POINTS));
22
+ const centre = STRIP_HEIGHT / 2;
23
+ const points = [];
24
+ for (let index = 0; index < samples.length; index += stride) {
25
+ const sample = samples[index];
26
+ if (sample === undefined || !Number.isFinite(sample)) {
27
+ continue;
28
+ }
29
+ const x = Math.min(width, index / sampleRate * speed * MILLIMETRE);
30
+ const y = centre - sample * gain * MILLIMETRE;
31
+ points.push(`${points.length === 0 ? "M" : "L"}${x.toFixed(2)} ${y.toFixed(2)}`);
32
+ }
33
+ return points.join(" ");
34
+ };
35
+ export const EcgStripViewer = ({
36
+ samples,
37
+ sampleRate,
38
+ speed = DEFAULT_SPEED,
39
+ gain = DEFAULT_GAIN,
40
+ pageDurationSeconds = DEFAULT_PAGE_DURATION,
41
+ initialPage = 0,
42
+ onPageChange,
43
+ testID,
44
+ theme: themeOverride,
45
+ slots
46
+ }) => {
47
+ const {
48
+ theme,
49
+ slots: uiSlots
50
+ } = useOvokUi({
51
+ theme: themeOverride,
52
+ slots
53
+ });
54
+ const Text = uiSlots.Text;
55
+ const Button = uiSlots.Button;
56
+ const safeSampleRate = Math.max(1, sampleRate);
57
+ const safePageDuration = Math.max(1, pageDurationSeconds);
58
+ const samplesPerPage = Math.max(1, Math.round(safeSampleRate * safePageDuration));
59
+ const pageCount = Math.max(1, Math.ceil(samples.length / samplesPerPage));
60
+ const [page, setPage] = React.useState(Math.min(Math.max(0, Math.floor(initialPage)), pageCount - 1));
61
+ const pageSamples = samples.slice(page * samplesPerPage, (page + 1) * samplesPerPage);
62
+ const pageWidth = Math.max(320, Math.round(Math.min(safePageDuration, pageSamples.length / safeSampleRate) * speed * MILLIMETRE));
63
+ const path = buildTracePath(pageSamples, safeSampleRate, speed, gain, pageWidth);
64
+ const totalDuration = samples.length / safeSampleRate;
65
+ const changePage = next => {
66
+ const bounded = Math.min(Math.max(0, next), pageCount - 1);
67
+ setPage(bounded);
68
+ onPageChange?.(bounded, pageCount);
69
+ };
70
+ return /*#__PURE__*/_jsxs(View, {
71
+ testID: testID,
72
+ style: styles.container,
73
+ children: [/*#__PURE__*/_jsxs(View, {
74
+ style: styles.header,
75
+ children: [Text ? /*#__PURE__*/_jsx(Text, {
76
+ variant: "titleMedium",
77
+ children: "ECG strip"
78
+ }) : null, Text ? /*#__PURE__*/_jsx(Text, {
79
+ variant: "bodySmall",
80
+ children: `${totalDuration.toFixed(1)} s · ${speed} mm/s · ${gain} mm/mV`
81
+ }) : null]
82
+ }), /*#__PURE__*/_jsx(ScrollView, {
83
+ horizontal: true,
84
+ showsHorizontalScrollIndicator: true,
85
+ testID: testID ? `${testID}-scroll` : undefined,
86
+ children: /*#__PURE__*/_jsxs(Svg, {
87
+ width: pageWidth,
88
+ height: STRIP_HEIGHT,
89
+ children: [range(Math.ceil(pageWidth / 20) + 1).map(index => /*#__PURE__*/_jsx(Line, {
90
+ x1: index * 20,
91
+ y1: 0,
92
+ x2: index * 20,
93
+ y2: STRIP_HEIGHT,
94
+ stroke: theme.colors.errorContainer,
95
+ strokeWidth: 1
96
+ }, `vertical-${index}`)), range(Math.ceil(STRIP_HEIGHT / 20) + 1).map(index => /*#__PURE__*/_jsx(Line, {
97
+ x1: 0,
98
+ y1: index * 20,
99
+ x2: pageWidth,
100
+ y2: index * 20,
101
+ stroke: theme.colors.errorContainer,
102
+ strokeWidth: 1
103
+ }, `horizontal-${index}`)), /*#__PURE__*/_jsx(Path, {
104
+ d: path,
105
+ fill: "none",
106
+ stroke: theme.colors.primary,
107
+ strokeWidth: 1.5
108
+ })]
109
+ })
110
+ }), /*#__PURE__*/_jsxs(View, {
111
+ style: styles.footer,
112
+ children: [Button ? /*#__PURE__*/_jsx(Button, {
113
+ mode: "outlined",
114
+ compact: true,
115
+ disabled: page === 0,
116
+ onPress: () => changePage(page - 1),
117
+ children: "Previous"
118
+ }) : /*#__PURE__*/_jsx(Pressable, {
119
+ disabled: page === 0,
120
+ onPress: () => changePage(page - 1),
121
+ children: Text ? /*#__PURE__*/_jsx(Text, {
122
+ children: "Previous"
123
+ }) : null
124
+ }), Text ? /*#__PURE__*/_jsxs(Text, {
125
+ variant: "bodyMedium",
126
+ children: ["Page ", page + 1, " of ", pageCount]
127
+ }) : null, Button ? /*#__PURE__*/_jsx(Button, {
128
+ mode: "outlined",
129
+ compact: true,
130
+ disabled: page >= pageCount - 1,
131
+ onPress: () => changePage(page + 1),
132
+ children: "Next"
133
+ }) : /*#__PURE__*/_jsx(Pressable, {
134
+ disabled: page >= pageCount - 1,
135
+ onPress: () => changePage(page + 1),
136
+ children: Text ? /*#__PURE__*/_jsx(Text, {
137
+ children: "Next"
138
+ }) : null
139
+ })]
140
+ })]
141
+ });
142
+ };
143
+ const styles = StyleSheet.create({
144
+ container: {
145
+ gap: 12,
146
+ overflow: "hidden"
147
+ },
148
+ header: {
149
+ flexDirection: "row",
150
+ justifyContent: "space-between",
151
+ alignItems: "center"
152
+ },
153
+ footer: {
154
+ flexDirection: "row",
155
+ justifyContent: "space-between",
156
+ alignItems: "center"
157
+ }
158
+ });
159
+ //# sourceMappingURL=ecg-strip-viewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Pressable","ScrollView","StyleSheet","View","Svg","Path","Line","useOvokUi","jsx","_jsx","jsxs","_jsxs","MILLIMETRE","DEFAULT_PAGE_DURATION","DEFAULT_SPEED","DEFAULT_GAIN","STRIP_HEIGHT","MAX_PATH_POINTS","range","count","Array","from","length","Math","max","_","index","buildTracePath","samples","sampleRate","speed","gain","width","stride","ceil","centre","points","sample","undefined","Number","isFinite","x","min","y","push","toFixed","join","EcgStripViewer","pageDurationSeconds","initialPage","onPageChange","testID","theme","themeOverride","slots","uiSlots","Text","Button","safeSampleRate","safePageDuration","samplesPerPage","round","pageCount","page","setPage","useState","floor","pageSamples","slice","pageWidth","path","totalDuration","changePage","next","bounded","style","styles","container","children","header","variant","horizontal","showsHorizontalScrollIndicator","height","map","x1","y1","x2","y2","stroke","colors","errorContainer","strokeWidth","d","fill","primary","footer","mode","compact","disabled","onPress","create","gap","overflow","flexDirection","justifyContent","alignItems"],"sourceRoot":"../../../../../src","sources":["modules/ui/components/ecg-strip-viewer.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,UAAU,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACtE,OAAOC,GAAG,IAAIC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAGlD,SAASC,SAAS,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAmB3C,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,qBAAqB,GAAG,EAAE;AAChC,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,YAAY,GAAG,EAAE;AACvB,MAAMC,YAAY,GAAG,GAAG;AACxB,MAAMC,eAAe,GAAG,IAAI;AAE5B,MAAMC,KAAK,GAAIC,KAAa,IAC1BC,KAAK,CAACC,IAAI,CAAC;EAAEC,MAAM,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEL,KAAK;AAAE,CAAC,EAAE,CAACM,CAAC,EAAEC,KAAK,KAAKA,KAAK,CAAC;AAEjE,MAAMC,cAAc,GAAGA,CACrBC,OAA0B,EAC1BC,UAAkB,EAClBC,KAAa,EACbC,IAAY,EACZC,KAAa,KACF;EACX,IAAI,CAACJ,OAAO,CAACN,MAAM,IAAIO,UAAU,IAAI,CAAC,EAAE;IACtC,OAAO,EAAE;EACX;EAEA,MAAMI,MAAM,GAAGV,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACW,IAAI,CAACN,OAAO,CAACN,MAAM,GAAGL,eAAe,CAAC,CAAC;EACvE,MAAMkB,MAAM,GAAGnB,YAAY,GAAG,CAAC;EAC/B,MAAMoB,MAAgB,GAAG,EAAE;EAE3B,KAAK,IAAIV,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGE,OAAO,CAACN,MAAM,EAAEI,KAAK,IAAI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EAAC,MAAI,EAACD,SAAS;MAAA,CAAO,CAAC,GAAG,IAAI,EAC9EL,MAAM,gBACLhD,IAAA,CAACgD,MAAM;QAACwC,IAAI,EAAC,UAAU;QAACC,OAAO;QAACC,QAAQ,EAAEpC,IAAI,IAAID,SAAS,GAAG,CAAE;QAACsC,OAAO,EAAEA,CAAA,KAAM5B,UAAU,CAACT,IAAI,GAAG,CAAC,CAAE;QAAAe,QAAA,EAAC;MAEtG,CAAQ,CAAC,gBAETrE,IAAA,CAACT,SAAS;QAACmG,QAAQ,EAAEpC,IAAI,IAAID,SAAS,GAAG,CAAE;QAACsC,OAAO,EAAEA,CAAA,KAAM5B,UAAU,CAACT,IAAI,GAAG,CAAC,CAAE;QAAAe,QAAA,EAC7EtB,IAAI,gBAAG/C,IAAA,CAAC+C,IAAI;UAAAsB,QAAA,EAAC;QAAI,CAAM,CAAC,GAAG;MAAI,CACvB,CACZ;IAAA,CACG,CAAC;EAAA,CACH,CAAC;AAEX,CAAC;AAED,MAAMF,MAAM,GAAG1E,UAAU,CAACmG,MAAM,CAAC;EAC/BxB,SAAS,EAAE;IAAEyB,GAAG,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAS,CAAC;EAC1CxB,MAAM,EAAE;IAAEyB,aAAa,EAAE,KAAK;IAAEC,cAAc,EAAE,eAAe;IAAEC,UAAU,EAAE;EAAS,CAAC;EACvFV,MAAM,EAAE;IAAEQ,aAAa,EAAE,KAAK;IAAEC,cAAc,EAAE,eAAe;IAAEC,UAAU,EAAE;EAAS;AACxF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { StyleSheet, View } from "react-native";
5
+ import { ActivityIndicator, Button as PaperButton, Card as PaperCard, Switch, Text as PaperText } from "react-native-paper";
6
+ import { useHealthImport } from "../../bt-management/index.js";
7
+ import { useOvokUi } from "../use-ovok-ui.js";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ const statusLabel = status => {
10
+ switch (status) {
11
+ case "authorized":
12
+ return "Up to date";
13
+ case "shouldRequest":
14
+ return "Waiting for permission";
15
+ case "refused":
16
+ return "Not shared";
17
+ case "unsupported":
18
+ return "Unavailable on this device";
19
+ default:
20
+ return "Checking access";
21
+ }
22
+ };
23
+ export const HealthImportCard = ({
24
+ types,
25
+ adapter,
26
+ background = false,
27
+ title = "Health data import",
28
+ labelForType = type => type,
29
+ testID,
30
+ ...uiProps
31
+ }) => {
32
+ const {
33
+ theme,
34
+ slots
35
+ } = useOvokUi(uiProps);
36
+ const Button = slots.Button ?? PaperButton;
37
+ const Card = slots.Card ?? PaperCard;
38
+ const Text = slots.Text ?? PaperText;
39
+ const {
40
+ enabled,
41
+ setEnabled,
42
+ statusByType,
43
+ notShared,
44
+ error
45
+ } = useHealthImport({
46
+ types,
47
+ background,
48
+ adapter
49
+ });
50
+ const [busy, setBusy] = React.useState(false);
51
+ const toggle = async next => {
52
+ setBusy(true);
53
+ try {
54
+ await setEnabled(next);
55
+ } finally {
56
+ setBusy(false);
57
+ }
58
+ };
59
+ return /*#__PURE__*/_jsx(Card, {
60
+ testID: testID,
61
+ style: {
62
+ borderRadius: theme.borderRadius(2)
63
+ },
64
+ children: /*#__PURE__*/_jsxs(View, {
65
+ style: styles.content,
66
+ children: [/*#__PURE__*/_jsxs(View, {
67
+ style: styles.header,
68
+ children: [/*#__PURE__*/_jsx(Text, {
69
+ variant: "titleMedium",
70
+ style: styles.grow,
71
+ children: title
72
+ }), busy ? /*#__PURE__*/_jsx(ActivityIndicator, {}) : /*#__PURE__*/_jsx(Switch, {
73
+ value: enabled,
74
+ onValueChange: value => void toggle(value)
75
+ })]
76
+ }), types.map(type => /*#__PURE__*/_jsxs(View, {
77
+ style: styles.row,
78
+ children: [/*#__PURE__*/_jsx(Text, {
79
+ children: labelForType(type)
80
+ }), /*#__PURE__*/_jsx(Text, {
81
+ children: statusLabel(statusByType[type])
82
+ })]
83
+ }, type)), notShared.length > 0 && /*#__PURE__*/_jsx(Text, {
84
+ style: [styles.notice, {
85
+ color: theme.colors.onSurfaceVariant
86
+ }],
87
+ children: "Some data types are not shared. You can enable them in your health app."
88
+ }), error && /*#__PURE__*/_jsx(Text, {
89
+ style: {
90
+ color: theme.colors.error
91
+ },
92
+ children: error.message
93
+ }), /*#__PURE__*/_jsx(Button, {
94
+ mode: "outlined",
95
+ disabled: busy,
96
+ onPress: () => void toggle(!enabled),
97
+ children: enabled ? "Stop import" : "Connect health data"
98
+ })]
99
+ })
100
+ });
101
+ };
102
+ const styles = StyleSheet.create({
103
+ content: {
104
+ padding: 16
105
+ },
106
+ header: {
107
+ alignItems: "center",
108
+ flexDirection: "row",
109
+ gap: 8
110
+ },
111
+ grow: {
112
+ flex: 1
113
+ },
114
+ row: {
115
+ flexDirection: "row",
116
+ justifyContent: "space-between",
117
+ paddingVertical: 6
118
+ },
119
+ notice: {
120
+ paddingBottom: 10,
121
+ paddingTop: 4
122
+ }
123
+ });
124
+ //# sourceMappingURL=health-import-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","ActivityIndicator","Button","PaperButton","Card","PaperCard","Switch","Text","PaperText","useHealthImport","useOvokUi","jsx","_jsx","jsxs","_jsxs","statusLabel","status","HealthImportCard","types","adapter","background","title","labelForType","type","testID","uiProps","theme","slots","enabled","setEnabled","statusByType","notShared","error","busy","setBusy","useState","toggle","next","style","borderRadius","children","styles","content","header","variant","grow","value","onValueChange","map","row","length","notice","color","colors","onSurfaceVariant","message","mode","disabled","onPress","create","padding","alignItems","flexDirection","gap","flex","justifyContent","paddingVertical","paddingBottom","paddingTop"],"sourceRoot":"../../../../../src","sources":["modules/ui/components/health-import-card.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SACEC,iBAAiB,EACjBC,MAAM,IAAIC,WAAW,EACrBC,IAAI,IAAIC,SA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KAAK,CAAC2B,MAAM,CAACC;QAAiB,CAAC,CAAE;QAAAd,QAAA,EAAC;MAAuE,CAAM,CACtJ,EACAR,KAAK,iBAAIpB,IAAA,CAACL,IAAI;QAAC+B,KAAK,EAAE;UAAEc,KAAK,EAAE1B,KAAK,CAAC2B,MAAM,CAACrB;QAAM,CAAE;QAAAQ,QAAA,EAAER,KAAK,CAACuB;MAAO,CAAO,CAAC,eAC5E3C,IAAA,CAACV,MAAM;QAACsD,IAAI,EAAC,UAAU;QAACC,QAAQ,EAAExB,IAAK;QAACyB,OAAO,EAAEA,CAAA,KAAM,KAAKtB,MAAM,CAAC,CAACR,OAAO,CAAE;QAAAY,QAAA,EAC1EZ,OAAO,GAAG,aAAa,GAAG;MAAqB,CAC1C,CAAC;IAAA,CACL;EAAC,CACH,CAAC;AAEX,CAAC;AAED,MAAMa,MAAM,GAAG1C,UAAU,CAAC4D,MAAM,CAAC;EAC/BjB,OAAO,EAAE;IAAEkB,OAAO,EAAE;EAAG,CAAC;EACxBjB,MAAM,EAAE;IAAEkB,UAAU,EAAE,QAAQ;IAAEC,aAAa,EAAE,KAAK;IAAEC,GAAG,EAAE;EAAE,CAAC;EAC9DlB,IAAI,EAAE;IAAEmB,IAAI,EAAE;EAAE,CAAC;EACjBf,GAAG,EAAE;IAAEa,aAAa,EAAE,KAAK;IAAEG,cAAc,EAAE,eAAe;IAAEC,eAAe,EAAE;EAAE,CAAC;EAClFf,MAAM,EAAE;IAAEgB,aAAa,EAAE,EAAE;IAAEC,UAAU,EAAE;EAAE;AAC7C,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+
3
+ /* eslint-disable import/group-exports */
4
+
5
+ import * as React from "react";
6
+ import { StyleSheet, View } from "react-native";
7
+ import { Button as PaperButton, Card as PaperCard, Text as PaperText, TextInput } from "react-native-paper";
8
+ import { measurementFieldCatalog } from "../../bt-management/index.js";
9
+ import { useOvokUi } from "../use-ovok-ui.js";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ export const ManualEntryForm = ({
12
+ measurementTypeKey,
13
+ saveMeasurement,
14
+ initialValues = {},
15
+ recordedAt = new Date(),
16
+ title = "Add measurement",
17
+ labelForField = field => field,
18
+ testID,
19
+ onSaved,
20
+ ...uiProps
21
+ }) => {
22
+ const {
23
+ theme,
24
+ slots
25
+ } = useOvokUi(uiProps);
26
+ const Button = slots.Button ?? PaperButton;
27
+ const Card = slots.Card ?? PaperCard;
28
+ const Text = slots.Text ?? PaperText;
29
+ const fields = measurementFieldCatalog[measurementTypeKey] ?? {};
30
+ const [values, setValues] = React.useState(() => Object.fromEntries(Object.keys(fields).map(field => [field, initialValues[field]?.toString() ?? ""])));
31
+ const [dateText, setDateText] = React.useState(recordedAt.toISOString());
32
+ const [error, setError] = React.useState();
33
+ const [saving, setSaving] = React.useState(false);
34
+ const save = async () => {
35
+ const data = {};
36
+ for (const [field, definition] of Object.entries(fields)) {
37
+ const raw = values[field]?.trim() ?? "";
38
+ const value = Number(raw);
39
+ if (definition.required && raw === "") {
40
+ setError(`${labelForField(field)} is required`);
41
+ return;
42
+ }
43
+ if (raw !== "" && (!Number.isFinite(value) || value < definition.min || value > definition.max)) {
44
+ setError(`${labelForField(field)} must be between ${definition.min} and ${definition.max} ${definition.unit}`);
45
+ return;
46
+ }
47
+ if (raw !== "") {
48
+ data[field] = value;
49
+ }
50
+ }
51
+ const nextDate = new Date(dateText);
52
+ if (Number.isNaN(nextDate.getTime())) {
53
+ setError("Enter a valid measurement date");
54
+ return;
55
+ }
56
+ setError(undefined);
57
+ setSaving(true);
58
+ const input = {
59
+ measurementTypeKey,
60
+ data,
61
+ recordedAt: nextDate
62
+ };
63
+ try {
64
+ await saveMeasurement(input);
65
+ onSaved?.(input);
66
+ } catch (cause) {
67
+ setError(cause instanceof Error ? cause.message : String(cause));
68
+ } finally {
69
+ setSaving(false);
70
+ }
71
+ };
72
+ return /*#__PURE__*/_jsx(Card, {
73
+ testID: testID,
74
+ style: {
75
+ borderRadius: theme.borderRadius(2)
76
+ },
77
+ children: /*#__PURE__*/_jsxs(View, {
78
+ style: styles.content,
79
+ children: [/*#__PURE__*/_jsx(Text, {
80
+ variant: "titleMedium",
81
+ children: title
82
+ }), Object.entries(fields).map(([field, definition]) => /*#__PURE__*/_jsx(TextInput, {
83
+ label: `${labelForField(field)} (${definition.unit})`,
84
+ value: values[field] ?? "",
85
+ onChangeText: value => setValues(current => ({
86
+ ...current,
87
+ [field]: value
88
+ })),
89
+ keyboardType: "decimal-pad",
90
+ error: Boolean(error && error.startsWith(labelForField(field)))
91
+ }, field)), /*#__PURE__*/_jsx(TextInput, {
92
+ label: "Measured at (ISO 8601)",
93
+ value: dateText,
94
+ onChangeText: setDateText,
95
+ autoCapitalize: "none"
96
+ }), error && /*#__PURE__*/_jsx(Text, {
97
+ style: {
98
+ color: theme.colors.error
99
+ },
100
+ children: error
101
+ }), /*#__PURE__*/_jsx(Button, {
102
+ mode: "contained",
103
+ loading: saving,
104
+ disabled: saving,
105
+ onPress: () => void save(),
106
+ children: "Save measurement"
107
+ })]
108
+ })
109
+ });
110
+ };
111
+ const styles = StyleSheet.create({
112
+ content: {
113
+ gap: 10,
114
+ padding: 16
115
+ }
116
+ });
117
+ //# sourceMappingURL=manual-entry-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","Button","PaperButton","Card","PaperCard","Text","PaperText","TextInput","measurementFieldCatalog","useOvokUi","jsx","_jsx","jsxs","_jsxs","ManualEntryForm","measurementTypeKey","saveMeasurement","initialValues","recordedAt","Date","title","labelForField","field","testID","onSaved","uiProps","theme","slots","fields","values","setValues","useState","Object","fromEntries","keys","map","toString","dateText","setDateText","toISOString","error","setError","saving","setSaving","save","data","definition","entries","raw","trim","value","Number","required","isFinite","min","max","unit","nextDate","isNaN","getTime","undefined","input","cause","Error","message","String","style","borderRadius","children","styles","content","variant","label","onChangeText","current","keyboardType","Boolean","startsWith","autoCapitalize","color","colors","mode","loading","disabled","onPress","create","gap","padding"],"sourceRoot":"../../../../../src","sources":["modules/ui/components/manual-entry-form.tsx"],"mappings":";;AAAA;;AAGA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SACEC,MAAM,IAAIC,WAAW,EACrBC,IAAI,IAAIC,SAAS,EACjBC,IAAI,IAAIC,SAAS,EACjBC,SAAS,QACJ,oBAAoB;AAE3B,SAASC,uBAAuB,QAAQ,8BAAqB;AAE7D,SAASC,SAAS,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAmB3C,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAC9BC,kBAAkB;EAClBC,eAAe;EACfC,aAAa,GAAG,CAAC,CAAC;EAClBC,UAAU,GAAG,IAAIC,IAAI,CAAC,CAAC;EACvBC,KAAK,GAAG,iBAAiB;EACzBC,aAAa,GAAIC,KAAK,IAAKA,KAAK;EAChCC,MAAM;EACNC,OAAO;EACP,GAAGC;AACiB,CAAC,KAAK;EAC1B,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGlB,SAAS,CAACgB,OAAO,CAAC;EAC3C,MAAMxB,MAAM,GAAG0B,KAAK,CAAC1B,MAAM,IAAIC,WAAW;EAC1C,MAAMC,IAAI,GAAGwB,KAAK,CAACxB,IAAI,IAAIC,SAAS;EACpC,MAAMC,IAAI,GAAGsB,KAAK,CAACtB,IAAI,IAAIC,SAAS;EAEpC,MAAMsB,MAAM,GAAGpB,uBAAuB,CAACO,kBAAkB,CAAC,IAAI,CAAC,CAAC;EAEhE,MAAM,CAACc,MAAM,EAAEC,SAAS,CAAC,GAAGhC,KAAK,CAACiC,QAAQ,CAAyB,MACjEC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,IAAI,CAACN,MAAM,CAAC,CAACO,GAAG,CAAEb,KAAK,IAAK,CAACA,KAAK,EAAEL,a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