@ovok/native 1.5.6 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -19
- package/android/src/main/AndroidManifest.xml +1 -20
- package/app.plugin.js +181 -0
- package/lib/commonjs/index.js +5 -104
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
- package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js +23 -0
- package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
- package/lib/commonjs/modules/auth/hooks/use-session.js +105 -0
- package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -0
- package/lib/commonjs/modules/auth/index.js +44 -0
- package/lib/commonjs/modules/auth/index.js.map +1 -1
- package/lib/commonjs/modules/auth/logout-button/components/logout-button.js +5 -2
- package/lib/commonjs/modules/auth/logout-button/components/logout-button.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/inputs.js +50 -1
- package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-button.js +4 -0
- package/lib/commonjs/modules/auth/register/components/form/register-button.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +6 -0
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js +12 -0
- package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/session/components/session-list.js +82 -0
- package/lib/commonjs/modules/auth/session/components/session-list.js.map +1 -0
- package/lib/commonjs/modules/auth/session/events.js +19 -0
- package/lib/commonjs/modules/auth/session/events.js.map +1 -0
- package/lib/commonjs/modules/auth/session/index.js +13 -0
- package/lib/commonjs/modules/auth/session/index.js.map +1 -0
- package/lib/commonjs/modules/auth/session/types/session-list-props.js +6 -0
- package/lib/commonjs/modules/auth/session/types/session-list-props.js.map +1 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js +26 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js +58 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
- package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js +13 -5
- package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
- package/lib/commonjs/modules/auth/types/session.js +2 -0
- package/lib/commonjs/modules/auth/types/session.js.map +1 -0
- package/lib/commonjs/modules/auth/utils/rate-limit.js +37 -0
- package/lib/commonjs/modules/auth/utils/rate-limit.js.map +1 -0
- package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
- package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/commonjs/modules/background-sync/background-safe-storage.js +76 -0
- package/lib/commonjs/modules/background-sync/background-safe-storage.js.map +1 -0
- package/lib/commonjs/modules/background-sync/index.js +11 -0
- package/lib/commonjs/modules/background-sync/index.js.map +1 -1
- package/lib/commonjs/modules/bt-device/index.js +0 -22
- package/lib/commonjs/modules/bt-device/index.js.map +1 -1
- package/lib/commonjs/modules/bt-device-instructions/index.js +39 -0
- package/lib/commonjs/modules/bt-device-instructions/index.js.map +1 -0
- package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js +64 -0
- package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js +1 -0
- package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +95 -0
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js +51 -0
- package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js +51 -0
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js +40 -0
- package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-health-import.js +82 -0
- package/lib/commonjs/modules/bt-management/hooks/use-health-import.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +79 -0
- package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js +33 -0
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js +58 -0
- package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js +21 -0
- package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js.map +1 -0
- package/lib/commonjs/modules/bt-management/index.js +154 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +91 -22
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +107 -4
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +9 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
- package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
- package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/push-notification.js +39 -0
- package/lib/commonjs/modules/bt-management/services/push-notification.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +132 -0
- package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/index.js +28 -0
- package/lib/commonjs/modules/bt-management/testing/index.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/recorded-frames.js +23 -0
- package/lib/commonjs/modules/bt-management/testing/recorded-frames.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/bluetooth-error.js +82 -0
- package/lib/commonjs/modules/bt-management/types/bluetooth-error.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/device-connection-event.js +6 -0
- package/lib/commonjs/modules/bt-management/types/device-connection-event.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/result-policy.js +6 -0
- package/lib/commonjs/modules/bt-management/types/result-policy.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/result-identity.js +63 -0
- package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -0
- package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
- package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +29 -4
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +2 -2
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js +29 -21
- package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/retry-save.js +99 -0
- package/lib/commonjs/modules/data-sync/utils/retry-save.js.map +1 -0
- package/lib/commonjs/modules/helpers/form-items/form-field.js +2 -0
- package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/commonjs/modules/helpers/index.js +23 -4
- package/lib/commonjs/modules/helpers/index.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/s-log.js +4 -13
- package/lib/commonjs/modules/helpers/utils/s-log.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/sentry-logger.js +27 -17
- package/lib/commonjs/modules/helpers/utils/sentry-logger.js.map +1 -1
- package/lib/commonjs/modules/helpers/utils/telemetry.js +230 -0
- package/lib/commonjs/modules/helpers/utils/telemetry.js.map +1 -0
- package/lib/commonjs/modules/image/components/optimized-image.js +31 -6
- package/lib/commonjs/modules/image/components/optimized-image.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +18 -9
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
- package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
- package/lib/commonjs/modules/tile/components/task-icon.js +2 -1
- package/lib/commonjs/modules/tile/components/task-icon.js.map +1 -1
- package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js +4 -1
- package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js.map +1 -1
- package/lib/commonjs/modules/ui/components/background-sync-setting.js +123 -0
- package/lib/commonjs/modules/ui/components/background-sync-setting.js.map +1 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +119 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -0
- package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js +175 -0
- package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js.map +1 -0
- package/lib/commonjs/modules/ui/components/health-import-card.js +141 -0
- package/lib/commonjs/modules/ui/components/health-import-card.js.map +1 -0
- package/lib/commonjs/modules/ui/components/manual-entry-form.js +136 -0
- package/lib/commonjs/modules/ui/components/manual-entry-form.js.map +1 -0
- package/lib/commonjs/modules/ui/components/pairing-flow.js +247 -0
- package/lib/commonjs/modules/ui/components/pairing-flow.js.map +1 -0
- package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js +107 -0
- package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
- package/lib/commonjs/modules/ui/components/urine-test-result.js +99 -0
- package/lib/commonjs/modules/ui/components/urine-test-result.js.map +1 -0
- package/lib/commonjs/modules/ui/index.js +116 -0
- package/lib/commonjs/modules/ui/index.js.map +1 -0
- package/lib/commonjs/modules/ui/types.js +6 -0
- package/lib/commonjs/modules/ui/types.js.map +1 -0
- package/lib/commonjs/modules/ui/use-ovok-ui.js +51 -0
- package/lib/commonjs/modules/ui/use-ovok-ui.js.map +1 -0
- package/lib/module/index.js +3 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
- package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js +17 -0
- package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
- package/lib/module/modules/auth/hooks/use-session.js +99 -0
- package/lib/module/modules/auth/hooks/use-session.js.map +1 -0
- package/lib/module/modules/auth/index.js +4 -0
- package/lib/module/modules/auth/index.js.map +1 -1
- package/lib/module/modules/auth/logout-button/components/logout-button.js +5 -2
- package/lib/module/modules/auth/logout-button/components/logout-button.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/inputs.js +50 -1
- package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-button.js +4 -0
- package/lib/module/modules/auth/register/components/form/register-button.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-form-provider.js +6 -0
- package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/inputs.js +12 -0
- package/lib/module/modules/auth/reset-password/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
- package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/module/modules/auth/session/components/session-list.js +76 -0
- package/lib/module/modules/auth/session/components/session-list.js.map +1 -0
- package/lib/module/modules/auth/session/events.js +13 -0
- package/lib/module/modules/auth/session/events.js.map +1 -0
- package/lib/module/modules/auth/session/index.js +4 -0
- package/lib/module/modules/auth/session/index.js.map +1 -0
- package/lib/module/modules/auth/session/types/session-list-props.js +4 -0
- package/lib/module/modules/auth/session/types/session-list-props.js.map +1 -0
- package/lib/module/modules/auth/sign-in/components/form/inputs.js +26 -0
- package/lib/module/modules/auth/sign-in/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
- package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js +52 -0
- package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
- package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
- package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/form/signin-button.js +13 -5
- package/lib/module/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
- package/lib/module/modules/auth/types/session.js +2 -0
- package/lib/module/modules/auth/types/session.js.map +1 -0
- package/lib/module/modules/auth/utils/rate-limit.js +31 -0
- package/lib/module/modules/auth/utils/rate-limit.js.map +1 -0
- package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
- package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/module/modules/background-sync/background-safe-storage.js +71 -0
- package/lib/module/modules/background-sync/background-safe-storage.js.map +1 -0
- package/lib/module/modules/background-sync/index.js +1 -0
- package/lib/module/modules/background-sync/index.js.map +1 -1
- package/lib/module/modules/bt-device/index.js +0 -2
- package/lib/module/modules/bt-device/index.js.map +1 -1
- package/lib/module/modules/bt-device-instructions/index.js +6 -0
- package/lib/module/modules/bt-device-instructions/index.js.map +1 -0
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +58 -0
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/constants/measurement-field-catalog.js +1 -0
- package/lib/module/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/runtime-context.js +86 -0
- package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-background-sync.js +45 -0
- package/lib/module/modules/bt-management/hooks/use-background-sync.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js +45 -0
- package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-device-connection.js +34 -0
- package/lib/module/modules/bt-management/hooks/use-device-connection.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-health-import.js +76 -0
- package/lib/module/modules/bt-management/hooks/use-health-import.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-measurements.js +73 -0
- package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-nearby-devices.js +27 -0
- package/lib/module/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-paired-devices.js +52 -0
- package/lib/module/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-scan-control.js +16 -0
- package/lib/module/modules/bt-management/hooks/use-scan-control.js.map +1 -0
- package/lib/module/modules/bt-management/index.js +14 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js +91 -22
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +107 -4
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +9 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
- package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
- package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
- package/lib/module/modules/bt-management/services/push-notification.js +34 -0
- package/lib/module/modules/bt-management/services/push-notification.js.map +1 -0
- package/lib/module/modules/bt-management/testing/fake-ble-manager.js +127 -0
- package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
- package/lib/module/modules/bt-management/testing/index.js +5 -0
- package/lib/module/modules/bt-management/testing/index.js.map +1 -0
- package/lib/module/modules/bt-management/testing/recorded-frames.js +17 -0
- package/lib/module/modules/bt-management/testing/recorded-frames.js.map +1 -0
- package/lib/module/modules/bt-management/types/bluetooth-error.js +76 -0
- package/lib/module/modules/bt-management/types/bluetooth-error.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-connection-event.js +4 -0
- package/lib/module/modules/bt-management/types/device-connection-event.js.map +1 -0
- package/lib/module/modules/bt-management/types/result-policy.js +4 -0
- package/lib/module/modules/bt-management/types/result-policy.js.map +1 -0
- package/lib/module/modules/bt-management/utils/result-identity.js +57 -0
- package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -0
- package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
- package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
- package/lib/module/modules/data-sync/services/base-health-sync-service.js +29 -4
- package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/data-processor.js +2 -2
- package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
- package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
- package/lib/module/modules/data-sync/utils/generate-observation-entry.js +29 -21
- package/lib/module/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
- package/lib/module/modules/data-sync/utils/retry-save.js +92 -0
- package/lib/module/modules/data-sync/utils/retry-save.js.map +1 -0
- package/lib/module/modules/helpers/form-items/form-field.js +2 -0
- package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/module/modules/helpers/index.js +2 -1
- package/lib/module/modules/helpers/index.js.map +1 -1
- package/lib/module/modules/helpers/utils/s-log.js +4 -12
- package/lib/module/modules/helpers/utils/s-log.js.map +1 -1
- package/lib/module/modules/helpers/utils/sentry-logger.js +25 -14
- package/lib/module/modules/helpers/utils/sentry-logger.js.map +1 -1
- package/lib/module/modules/helpers/utils/telemetry.js +218 -0
- package/lib/module/modules/helpers/utils/telemetry.js.map +1 -0
- package/lib/module/modules/image/components/optimized-image.js +32 -7
- package/lib/module/modules/image/components/optimized-image.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +20 -11
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
- package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
- package/lib/module/modules/tile/components/task-icon.js +2 -1
- package/lib/module/modules/tile/components/task-icon.js.map +1 -1
- package/lib/module/modules/tile/constants/measurement-icon-svg.js +4 -1
- package/lib/module/modules/tile/constants/measurement-icon-svg.js.map +1 -1
- package/lib/module/modules/ui/components/background-sync-setting.js +117 -0
- package/lib/module/modules/ui/components/background-sync-setting.js.map +1 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js +113 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -0
- package/lib/module/modules/ui/components/ecg-strip-viewer.js +169 -0
- package/lib/module/modules/ui/components/ecg-strip-viewer.js.map +1 -0
- package/lib/module/modules/ui/components/health-import-card.js +135 -0
- package/lib/module/modules/ui/components/health-import-card.js.map +1 -0
- package/lib/module/modules/ui/components/manual-entry-form.js +130 -0
- package/lib/module/modules/ui/components/manual-entry-form.js.map +1 -0
- package/lib/module/modules/ui/components/pairing-flow.js +241 -0
- package/lib/module/modules/ui/components/pairing-flow.js.map +1 -0
- package/lib/module/modules/ui/components/supported-devices-catalog-list.js +101 -0
- package/lib/module/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
- package/lib/module/modules/ui/components/urine-test-result.js +94 -0
- package/lib/module/modules/ui/components/urine-test-result.js.map +1 -0
- package/lib/module/modules/ui/index.js +13 -0
- package/lib/module/modules/ui/index.js.map +1 -0
- package/lib/module/modules/ui/types.js +4 -0
- package/lib/module/modules/ui/types.js.map +1 -0
- package/lib/module/modules/ui/use-ovok-ui.js +45 -0
- package/lib/module/modules/ui/use-ovok-ui.js.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +0 -9
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
- package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
- package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts +31 -0
- package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts +0 -2
- package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts +5 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/helpers/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/s-log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts +69 -0
- package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/tile/components/task-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/types.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/ui/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +0 -9
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +16 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/index.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/events.d.ts +5 -0
- package/lib/typescript/module/src/modules/auth/session/events.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/index.d.ts +3 -0
- package/lib/typescript/module/src/modules/auth/session/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts +5 -0
- package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
- package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
- package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
- package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/types/session.d.ts +10 -0
- package/lib/typescript/module/src/modules/auth/types/session.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts +11 -0
- package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts +31 -0
- package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/background-sync/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/background-sync/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/index.d.ts +0 -2
- package/lib/typescript/module/src/modules/bt-device/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +22 -0
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
- package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
- package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts +5 -2
- package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
- package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts +6 -0
- package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts +4 -1
- package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/index.d.ts +2 -1
- package/lib/typescript/module/src/modules/helpers/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/utils/s-log.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
- package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts +69 -0
- package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts +1 -1
- package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts +4 -0
- package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/tile/components/task-icon.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
- package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts +9 -0
- package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
- package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts +13 -0
- package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts +21 -0
- package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts +15 -0
- package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
- package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts +10 -0
- package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts +11 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/types.d.ts +24 -0
- package/lib/typescript/module/src/modules/ui/types.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts +7 -0
- package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
- package/package.json +146 -7
|
@@ -0,0 +1,113 @@
|
|
|
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
|
+
const [actionError, setActionError] = React.useState();
|
|
33
|
+
if (state === "on") {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const openSettings = async () => {
|
|
37
|
+
if (onOpenSettings) {
|
|
38
|
+
await onOpenSettings();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
await Linking.openSettings();
|
|
42
|
+
};
|
|
43
|
+
const takeAction = async () => {
|
|
44
|
+
setBusy(true);
|
|
45
|
+
setActionError(undefined);
|
|
46
|
+
try {
|
|
47
|
+
if (state === "unauthorized") {
|
|
48
|
+
const granted = await request();
|
|
49
|
+
if (granted) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (state === "off") {
|
|
54
|
+
await openSettings();
|
|
55
|
+
}
|
|
56
|
+
} catch (cause) {
|
|
57
|
+
setActionError(cause instanceof Error ? cause.message : String(cause));
|
|
58
|
+
} finally {
|
|
59
|
+
setBusy(false);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const copy = state === "unsupported" ? {
|
|
63
|
+
heading: title ?? "Bluetooth is not supported",
|
|
64
|
+
body: "This device cannot use Bluetooth Low Energy.",
|
|
65
|
+
action: undefined
|
|
66
|
+
} : state === "unauthorized" ? {
|
|
67
|
+
heading: title ?? "Bluetooth permission is required",
|
|
68
|
+
body: Platform.OS === "android" ? "Allow Nearby devices permission to find health devices." : "Allow Bluetooth access to find health devices.",
|
|
69
|
+
action: "Allow access"
|
|
70
|
+
} : {
|
|
71
|
+
heading: title ?? "Bluetooth is off",
|
|
72
|
+
body: "Turn on Bluetooth to find and connect to health devices.",
|
|
73
|
+
action: "Open Bluetooth settings"
|
|
74
|
+
};
|
|
75
|
+
return /*#__PURE__*/_jsx(Card, {
|
|
76
|
+
theme: theme,
|
|
77
|
+
testID: testID,
|
|
78
|
+
style: {
|
|
79
|
+
borderRadius: theme.borderRadius(2)
|
|
80
|
+
},
|
|
81
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
82
|
+
style: styles.content,
|
|
83
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
84
|
+
theme: theme,
|
|
85
|
+
variant: "titleMedium",
|
|
86
|
+
children: copy.heading
|
|
87
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
88
|
+
theme: theme,
|
|
89
|
+
children: copy.body
|
|
90
|
+
}), actionError && /*#__PURE__*/_jsx(Text, {
|
|
91
|
+
theme: theme,
|
|
92
|
+
style: {
|
|
93
|
+
color: theme.colors.error
|
|
94
|
+
},
|
|
95
|
+
children: actionError
|
|
96
|
+
}), copy.action && /*#__PURE__*/_jsx(Button, {
|
|
97
|
+
theme: theme,
|
|
98
|
+
loading: busy,
|
|
99
|
+
disabled: busy,
|
|
100
|
+
mode: "contained",
|
|
101
|
+
onPress: () => void takeAction(),
|
|
102
|
+
children: copy.action
|
|
103
|
+
})]
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const styles = StyleSheet.create({
|
|
108
|
+
content: {
|
|
109
|
+
gap: 10,
|
|
110
|
+
padding: 16
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
//# 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","actionError","setActionError","openSettings","takeAction","undefined","granted","cause","Error","message","String","copy","heading","body","action","OS","style","borderRadius","children","styles","content","variant","color","colors","error","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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,IAAI;QAACe,KAAK,EAAEA,KAAM;QAAC2B,OAAO,EAAC,aAAa;QAAAH,QAAA,EAAEP,IAAI,CAACC;MAAO,CAAO,CAAC,eAC/D5B,IAAA,CAACL,IAAI;QAACe,KAAK,EAAEA,KAAM;QAAAwB,QAAA,EAAEP,IAAI,CAACE;MAAI,CAAO,CAAC,EACrCZ,WAAW,iBAAIjB,IAAA,CAACL,IAAI;QAACe,KAAK,EAAEA,KAAM;QAACsB,KAAK,EAAE;UAAEM,KAAK,EAAE5B,KAAK,CAAC6B,MAAM,CAACC;QAAM,CAAE;QAAAN,QAAA,EAAEjB;MAAW,CAAO,CAAC,EAC7FU,IAAI,CAACG,MAAM,iBACV9B,IAAA,CAACT,MAAM;QAACmB,KAAK,EAAEA,KAAM;QAAC+B,OAAO,EAAE3B,IAAK;QAAC4B,QAAQ,EAAE5B,IAAK;QAAC6B,IAAI,EAAC,WAAW;QAACC,OAAO,EAAEA,CAAA,KAAM,KAAKxB,UAAU,CAAC,CAAE;QAAAc,QAAA,EACpGP,IAAI,CAACG;MAAM,CACN,CACT;IAAA,CACG;EAAC,CACH,CAAC;AAEX,CAAC;AAED,MAAMK,MAAM,GAAG9C,UAAU,CAACwD,MAAM,CAAC;EAAET,OAAO,EAAE;IAAEU,GAAG,EAAE,EAAE;IAAEC,OAAO,EAAE;EAAG;AAAE,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
React.useEffect(() => {
|
|
62
|
+
setPage(Math.min(Math.max(0, Math.floor(initialPage)), pageCount - 1));
|
|
63
|
+
}, [initialPage, pageCount, pageDurationSeconds, sampleRate, samples]);
|
|
64
|
+
const pageSamples = samples.slice(page * samplesPerPage, (page + 1) * samplesPerPage);
|
|
65
|
+
const pageWidth = Math.max(320, Math.round(Math.min(safePageDuration, pageSamples.length / safeSampleRate) * speed * MILLIMETRE));
|
|
66
|
+
const path = buildTracePath(pageSamples, safeSampleRate, speed, gain, pageWidth);
|
|
67
|
+
const totalDuration = samples.length / safeSampleRate;
|
|
68
|
+
const changePage = next => {
|
|
69
|
+
const bounded = Math.min(Math.max(0, next), pageCount - 1);
|
|
70
|
+
setPage(bounded);
|
|
71
|
+
onPageChange?.(bounded, pageCount);
|
|
72
|
+
};
|
|
73
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
74
|
+
testID: testID,
|
|
75
|
+
style: styles.container,
|
|
76
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
77
|
+
style: styles.header,
|
|
78
|
+
children: [Text ? /*#__PURE__*/_jsx(Text, {
|
|
79
|
+
theme: theme,
|
|
80
|
+
variant: "titleMedium",
|
|
81
|
+
children: "ECG strip"
|
|
82
|
+
}) : null, Text ? /*#__PURE__*/_jsx(Text, {
|
|
83
|
+
theme: theme,
|
|
84
|
+
variant: "bodySmall",
|
|
85
|
+
children: `${totalDuration.toFixed(1)} s · ${speed} mm/s · ${gain} mm/mV`
|
|
86
|
+
}) : null]
|
|
87
|
+
}), /*#__PURE__*/_jsx(ScrollView, {
|
|
88
|
+
horizontal: true,
|
|
89
|
+
showsHorizontalScrollIndicator: true,
|
|
90
|
+
testID: testID ? `${testID}-scroll` : undefined,
|
|
91
|
+
children: /*#__PURE__*/_jsxs(Svg, {
|
|
92
|
+
width: pageWidth,
|
|
93
|
+
height: STRIP_HEIGHT,
|
|
94
|
+
children: [range(Math.ceil(pageWidth / 20) + 1).map(index => /*#__PURE__*/_jsx(Line, {
|
|
95
|
+
x1: index * 20,
|
|
96
|
+
y1: 0,
|
|
97
|
+
x2: index * 20,
|
|
98
|
+
y2: STRIP_HEIGHT,
|
|
99
|
+
stroke: theme.colors.errorContainer,
|
|
100
|
+
strokeWidth: 1
|
|
101
|
+
}, `vertical-${index}`)), range(Math.ceil(STRIP_HEIGHT / 20) + 1).map(index => /*#__PURE__*/_jsx(Line, {
|
|
102
|
+
x1: 0,
|
|
103
|
+
y1: index * 20,
|
|
104
|
+
x2: pageWidth,
|
|
105
|
+
y2: index * 20,
|
|
106
|
+
stroke: theme.colors.errorContainer,
|
|
107
|
+
strokeWidth: 1
|
|
108
|
+
}, `horizontal-${index}`)), /*#__PURE__*/_jsx(Path, {
|
|
109
|
+
d: path,
|
|
110
|
+
fill: "none",
|
|
111
|
+
stroke: theme.colors.primary,
|
|
112
|
+
strokeWidth: 1.5
|
|
113
|
+
})]
|
|
114
|
+
})
|
|
115
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
116
|
+
style: styles.footer,
|
|
117
|
+
children: [Button ? /*#__PURE__*/_jsx(Button, {
|
|
118
|
+
theme: theme,
|
|
119
|
+
mode: "outlined",
|
|
120
|
+
compact: true,
|
|
121
|
+
disabled: page === 0,
|
|
122
|
+
onPress: () => changePage(page - 1),
|
|
123
|
+
children: "Previous"
|
|
124
|
+
}) : /*#__PURE__*/_jsx(Pressable, {
|
|
125
|
+
disabled: page === 0,
|
|
126
|
+
onPress: () => changePage(page - 1),
|
|
127
|
+
children: Text ? /*#__PURE__*/_jsx(Text, {
|
|
128
|
+
theme: theme,
|
|
129
|
+
children: "Previous"
|
|
130
|
+
}) : null
|
|
131
|
+
}), Text ? /*#__PURE__*/_jsxs(Text, {
|
|
132
|
+
theme: theme,
|
|
133
|
+
variant: "bodyMedium",
|
|
134
|
+
children: ["Page ", page + 1, " of ", pageCount]
|
|
135
|
+
}) : null, Button ? /*#__PURE__*/_jsx(Button, {
|
|
136
|
+
theme: theme,
|
|
137
|
+
mode: "outlined",
|
|
138
|
+
compact: true,
|
|
139
|
+
disabled: page >= pageCount - 1,
|
|
140
|
+
onPress: () => changePage(page + 1),
|
|
141
|
+
children: "Next"
|
|
142
|
+
}) : /*#__PURE__*/_jsx(Pressable, {
|
|
143
|
+
disabled: page >= pageCount - 1,
|
|
144
|
+
onPress: () => changePage(page + 1),
|
|
145
|
+
children: Text ? /*#__PURE__*/_jsx(Text, {
|
|
146
|
+
theme: theme,
|
|
147
|
+
children: "Next"
|
|
148
|
+
}) : null
|
|
149
|
+
})]
|
|
150
|
+
})]
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
const styles = StyleSheet.create({
|
|
154
|
+
container: {
|
|
155
|
+
gap: 12,
|
|
156
|
+
overflow: "hidden"
|
|
157
|
+
},
|
|
158
|
+
header: {
|
|
159
|
+
flexDirection: "row",
|
|
160
|
+
justifyContent: "space-between",
|
|
161
|
+
alignItems: "center"
|
|
162
|
+
},
|
|
163
|
+
footer: {
|
|
164
|
+
flexDirection: "row",
|
|
165
|
+
justifyContent: "space-between",
|
|
166
|
+
alignItems: "center"
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
//# 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","useEffect","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,O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AO,EAAEA,CAAA,KAAM5B,UAAU,CAACV,IAAI,GAAG,CAAC,CAAE;QAAAgB,QAAA,EAC7EvB,IAAI,gBAAG/C,IAAA,CAAC+C,IAAI;UAACJ,KAAK,EAAEA,KAAM;UAAA2B,QAAA,EAAC;QAAI,CAAM,CAAC,GAAG;MAAI,CACrC,CACZ;IAAA,CACG,CAAC;EAAA,CACH,CAAC;AAEX,CAAC;AAED,MAAMF,MAAM,GAAG3E,UAAU,CAACoG,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,135 @@
|
|
|
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
|
+
theme: theme,
|
|
61
|
+
testID: testID,
|
|
62
|
+
style: {
|
|
63
|
+
borderRadius: theme.borderRadius(2)
|
|
64
|
+
},
|
|
65
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
66
|
+
style: styles.content,
|
|
67
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
68
|
+
style: styles.header,
|
|
69
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
70
|
+
theme: theme,
|
|
71
|
+
variant: "titleMedium",
|
|
72
|
+
style: styles.grow,
|
|
73
|
+
children: title
|
|
74
|
+
}), busy ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
75
|
+
theme: theme
|
|
76
|
+
}) : /*#__PURE__*/_jsx(Switch, {
|
|
77
|
+
accessibilityLabel: title,
|
|
78
|
+
theme: theme,
|
|
79
|
+
value: enabled,
|
|
80
|
+
onValueChange: value => void toggle(value)
|
|
81
|
+
})]
|
|
82
|
+
}), types.map(type => /*#__PURE__*/_jsxs(View, {
|
|
83
|
+
style: styles.row,
|
|
84
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
85
|
+
theme: theme,
|
|
86
|
+
children: labelForType(type)
|
|
87
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
88
|
+
theme: theme,
|
|
89
|
+
children: statusLabel(statusByType[type])
|
|
90
|
+
})]
|
|
91
|
+
}, type)), notShared.length > 0 && /*#__PURE__*/_jsx(Text, {
|
|
92
|
+
theme: theme,
|
|
93
|
+
style: [styles.notice, {
|
|
94
|
+
color: theme.colors.onSurfaceVariant
|
|
95
|
+
}],
|
|
96
|
+
children: "Some data types are not shared. You can enable them in your health app."
|
|
97
|
+
}), error && /*#__PURE__*/_jsx(Text, {
|
|
98
|
+
theme: theme,
|
|
99
|
+
style: {
|
|
100
|
+
color: theme.colors.error
|
|
101
|
+
},
|
|
102
|
+
children: error.message
|
|
103
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
104
|
+
theme: theme,
|
|
105
|
+
mode: "outlined",
|
|
106
|
+
disabled: busy,
|
|
107
|
+
onPress: () => void toggle(!enabled),
|
|
108
|
+
children: enabled ? "Stop import" : "Connect health data"
|
|
109
|
+
})]
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
const styles = StyleSheet.create({
|
|
114
|
+
content: {
|
|
115
|
+
padding: 16
|
|
116
|
+
},
|
|
117
|
+
header: {
|
|
118
|
+
alignItems: "center",
|
|
119
|
+
flexDirection: "row",
|
|
120
|
+
gap: 8
|
|
121
|
+
},
|
|
122
|
+
grow: {
|
|
123
|
+
flex: 1
|
|
124
|
+
},
|
|
125
|
+
row: {
|
|
126
|
+
flexDirection: "row",
|
|
127
|
+
justifyContent: "space-between",
|
|
128
|
+
paddingVertical: 6
|
|
129
|
+
},
|
|
130
|
+
notice: {
|
|
131
|
+
paddingBottom: 10,
|
|
132
|
+
paddingTop: 4
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
//# 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","accessibilityLabel","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,SAAS,EACjBC,MAAM,EACNC,IAAI,IAAIC,SAAS,QACZ,oBAAoB;AAE3B,SAA8BC,eAAe,QAAQ,8BAAqB;AAE1E,SAASC,SAAS,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAW3C,MAAMC,WAAW,GAAIC,MAAe,IAAa;EAC/C,QAAQA,MAAM;IACZ,KAAK,YAAY;MAAE,OAAO,YAAY;IACtC,KAAK,eAAe;MAAE,OAAO,wBAAwB;IACrD,KAAK,SAAS;MAAE,OAAO,YAAY;IACnC,KAAK,aAAa;MAAE,OAAO,4BAA4B;IACvD;MAAS,OAAO,iBAAiB;EACnC;AACF,CAAC;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QAAAQ,QAAA,EAAER,KAAK,CAACwB;MAAO,CAAO,CAAC,eAC1F5C,IAAA,CAACV,MAAM;QAACwB,KAAK,EAAEA,KAAM;QAAC+B,IAAI,EAAC,UAAU;QAACC,QAAQ,EAAEzB,IAAK;QAAC0B,OAAO,EAAEA,CAAA,KAAM,KAAKvB,MAAM,CAAC,CAACR,OAAO,CAAE;QAAAY,QAAA,EACxFZ,OAAO,GAAG,aAAa,GAAG;MAAqB,CAC1C,CAAC;IAAA,CACL;EAAC,CACH,CAAC;AAEX,CAAC;AAED,MAAMa,MAAM,GAAG1C,UAAU,CAAC6D,MAAM,CAAC;EAC/BlB,OAAO,EAAE;IAAEmB,OAAO,EAAE;EAAG,CAAC;EACxBlB,MAAM,EAAE;IAAEmB,UAAU,EAAE,QAAQ;IAAEC,aAAa,EAAE,KAAK;IAAEC,GAAG,EAAE;EAAE,CAAC;EAC9DnB,IAAI,EAAE;IAAEoB,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,130 @@
|
|
|
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
|
+
labelForUnit = unit => unit === "Cel" ? "°C" : unit,
|
|
21
|
+
...uiProps
|
|
22
|
+
}) => {
|
|
23
|
+
const {
|
|
24
|
+
theme,
|
|
25
|
+
slots
|
|
26
|
+
} = useOvokUi(uiProps);
|
|
27
|
+
const Button = slots.Button ?? PaperButton;
|
|
28
|
+
const Card = slots.Card ?? PaperCard;
|
|
29
|
+
const Text = slots.Text ?? PaperText;
|
|
30
|
+
const fields = measurementFieldCatalog[measurementTypeKey] ?? {};
|
|
31
|
+
const [values, setValues] = React.useState(() => Object.fromEntries(Object.keys(fields).map(field => [field, initialValues[field]?.toString() ?? ""])));
|
|
32
|
+
const [dateText, setDateText] = React.useState(recordedAt.toISOString());
|
|
33
|
+
const [error, setError] = React.useState();
|
|
34
|
+
const [saving, setSaving] = React.useState(false);
|
|
35
|
+
const savingRef = React.useRef(false);
|
|
36
|
+
const save = async () => {
|
|
37
|
+
if (savingRef.current) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const data = {};
|
|
41
|
+
for (const [field, definition] of Object.entries(fields)) {
|
|
42
|
+
const raw = values[field]?.trim() ?? "";
|
|
43
|
+
const value = Number(raw);
|
|
44
|
+
if (definition.required && raw === "") {
|
|
45
|
+
setError(`${labelForField(field)} is required`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (raw !== "" && (!Number.isFinite(value) || value < definition.min || value > definition.max)) {
|
|
49
|
+
setError(`${labelForField(field)} must be between ${definition.min} and ${definition.max} ${definition.unit}`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (raw !== "") {
|
|
53
|
+
data[field] = value;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const nextDate = new Date(dateText);
|
|
57
|
+
if (Number.isNaN(nextDate.getTime())) {
|
|
58
|
+
setError("Enter a valid measurement date");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
setError(undefined);
|
|
62
|
+
savingRef.current = true;
|
|
63
|
+
setSaving(true);
|
|
64
|
+
const input = {
|
|
65
|
+
measurementTypeKey,
|
|
66
|
+
data,
|
|
67
|
+
recordedAt: nextDate
|
|
68
|
+
};
|
|
69
|
+
try {
|
|
70
|
+
await saveMeasurement(input);
|
|
71
|
+
onSaved?.(input);
|
|
72
|
+
} catch (cause) {
|
|
73
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
74
|
+
} finally {
|
|
75
|
+
savingRef.current = false;
|
|
76
|
+
setSaving(false);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return /*#__PURE__*/_jsx(Card, {
|
|
80
|
+
theme: theme,
|
|
81
|
+
testID: testID,
|
|
82
|
+
style: {
|
|
83
|
+
borderRadius: theme.borderRadius(2)
|
|
84
|
+
},
|
|
85
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
86
|
+
style: styles.content,
|
|
87
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
88
|
+
theme: theme,
|
|
89
|
+
variant: "titleMedium",
|
|
90
|
+
children: title
|
|
91
|
+
}), Object.entries(fields).map(([field, definition]) => /*#__PURE__*/_jsx(TextInput, {
|
|
92
|
+
theme: theme,
|
|
93
|
+
label: `${labelForField(field)} (${labelForUnit(definition.unit)})`,
|
|
94
|
+
value: values[field] ?? "",
|
|
95
|
+
onChangeText: value => setValues(current => ({
|
|
96
|
+
...current,
|
|
97
|
+
[field]: value
|
|
98
|
+
})),
|
|
99
|
+
keyboardType: "decimal-pad",
|
|
100
|
+
error: Boolean(error && error.startsWith(labelForField(field)))
|
|
101
|
+
}, field)), /*#__PURE__*/_jsx(TextInput, {
|
|
102
|
+
theme: theme,
|
|
103
|
+
label: "Measured at (ISO 8601)",
|
|
104
|
+
value: dateText,
|
|
105
|
+
onChangeText: setDateText,
|
|
106
|
+
autoCapitalize: "none"
|
|
107
|
+
}), error && /*#__PURE__*/_jsx(Text, {
|
|
108
|
+
theme: theme,
|
|
109
|
+
style: {
|
|
110
|
+
color: theme.colors.error
|
|
111
|
+
},
|
|
112
|
+
children: error
|
|
113
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
114
|
+
theme: theme,
|
|
115
|
+
mode: "contained",
|
|
116
|
+
loading: saving,
|
|
117
|
+
disabled: saving,
|
|
118
|
+
onPress: () => void save(),
|
|
119
|
+
children: "Save measurement"
|
|
120
|
+
})]
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
const styles = StyleSheet.create({
|
|
125
|
+
content: {
|
|
126
|
+
gap: 10,
|
|
127
|
+
padding: 16
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
//# 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","labelForUnit","unit","uiProps","theme","slots","fields","values","setValues","useState","Object","fromEntries","keys","map","toString","dateText","setDateText","toISOString","error","setError","saving","setSaving","savingRef","useRef","save","current","data","definition","entries","raw","trim","value","Number","required","isFinite","min","max","nextDate","isNaN","getTime","undefined","input","cause","Error","message","String","style","borderRadius","children","styles","content","variant","label","onChangeText","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,EACr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