@adminide-stack/yantra-mobile 12.0.136-alpha.1 → 12.0.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/lib/compute.js +51 -1
  2. package/lib/compute.js.map +1 -1
  3. package/lib/features/apps/AppsCatalog.js +10 -0
  4. package/lib/features/apps/AppsCatalog.js.map +1 -1
  5. package/lib/features/apps/mobileAppCatalog.js +9 -0
  6. package/lib/features/apps/mobileAppCatalog.js.map +1 -1
  7. package/lib/features/apps/nativeSurfaceTwin.js +1 -0
  8. package/lib/features/apps/nativeSurfaceTwin.js.map +1 -1
  9. package/lib/features/devices/bodyComposition.js +116 -0
  10. package/lib/features/devices/bodyComposition.js.map +1 -0
  11. package/lib/features/devices/readings.js.map +1 -1
  12. package/lib/features/devices/session.js +22 -2
  13. package/lib/features/devices/session.js.map +1 -1
  14. package/lib/features/dictate/DictateExperience.js +387 -0
  15. package/lib/features/dictate/DictateExperience.js.map +1 -0
  16. package/lib/features/dictate/components/DictationList.js +110 -0
  17. package/lib/features/dictate/components/DictationList.js.map +1 -0
  18. package/lib/features/dictate/components/NoteView.js +330 -0
  19. package/lib/features/dictate/components/NoteView.js.map +1 -0
  20. package/lib/features/dictate/components/RecordPanel.js +218 -0
  21. package/lib/features/dictate/components/RecordPanel.js.map +1 -0
  22. package/lib/features/dictate/dictateClient.js +98 -0
  23. package/lib/features/dictate/dictateClient.js.map +1 -0
  24. package/lib/features/dictate/dictateTheme.js +46 -0
  25. package/lib/features/dictate/dictateTheme.js.map +1 -0
  26. package/lib/features/dictate/dictationStore.js +107 -0
  27. package/lib/features/dictate/dictationStore.js.map +1 -0
  28. package/lib/features/dictate/noteText.js +35 -0
  29. package/lib/features/dictate/noteText.js.map +1 -0
  30. package/lib/features/dictate/useDictationRecorder.js +121 -0
  31. package/lib/features/dictate/useDictationRecorder.js.map +1 -0
  32. package/lib/routes.json +50 -0
  33. package/lib/screens/Devices/index.js +205 -3
  34. package/lib/screens/Devices/index.js.map +1 -1
  35. package/lib/screens/DictateNative/index.js +36 -0
  36. package/lib/screens/DictateNative/index.js.map +1 -0
  37. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- import {jsxs,jsx,Fragment}from'react/jsx-runtime';import React__default,{useState,useMemo,useCallback,useEffect,useRef}from'react';import {BackHandler,StyleSheet,View,Pressable,ActivityIndicator,ScrollView,Linking,Alert,Animated,Easing,Platform}from'react-native';import {Ionicons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useNavigation,useRoute,CommonActions}from'@react-navigation/native';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {mobileColors,mobileTokens}from'../../theme/mobileTokens.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {deviceKind,DEVICE_KINDS}from'../../features/devices/catalog.js';import {useDevices,useDeviceSession,platformWriter,deviceStore}from'../../features/devices/devices.js';import {describeReading}from'../../features/devices/readings.js';import {useHealthSync}from'../../features/health/healthSync.js';var __defProp = Object.defineProperty;
1
+ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import React__default,{useState,useMemo,useCallback,useEffect,useRef}from'react';import {BackHandler,StyleSheet,View,Pressable,ActivityIndicator,ScrollView,Linking,Alert,Animated,Easing,Platform}from'react-native';import {Ionicons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useNavigation,useRoute,CommonActions}from'@react-navigation/native';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {mobileColors,mobileTokens}from'../../theme/mobileTokens.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {deviceKind,DEVICE_KINDS}from'../../features/devices/catalog.js';import {useDevices,useDeviceSession,platformWriter,deviceStore}from'../../features/devices/devices.js';import {describeReading}from'../../features/devices/readings.js';import {compositionRows}from'../../features/devices/bodyComposition.js';import {useHealthSync}from'../../features/health/healthSync.js';var __defProp = Object.defineProperty;
2
2
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
3
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
4
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -305,6 +305,53 @@ const styles = StyleSheet.create({
305
305
  fontSize: 14,
306
306
  marginTop: 2
307
307
  },
308
+ measureBox: {
309
+ alignItems: "center",
310
+ paddingVertical: 24,
311
+ gap: 6
312
+ },
313
+ measureRing: {
314
+ position: "absolute",
315
+ top: 24,
316
+ width: 176,
317
+ height: 176,
318
+ borderRadius: 88,
319
+ borderWidth: 2
320
+ },
321
+ measureCore: {
322
+ width: 176,
323
+ height: 176,
324
+ borderRadius: 88,
325
+ alignItems: "center",
326
+ justifyContent: "center",
327
+ marginBottom: 12
328
+ },
329
+ measureWeight: {
330
+ fontSize: 44,
331
+ fontWeight: "700"
332
+ },
333
+ measureUnit: {
334
+ fontSize: 18,
335
+ fontWeight: "600"
336
+ },
337
+ compositionGrid: {
338
+ flexDirection: "row",
339
+ flexWrap: "wrap",
340
+ marginTop: 10,
341
+ rowGap: 10
342
+ },
343
+ compositionItem: {
344
+ width: "33.33%",
345
+ paddingRight: 8
346
+ },
347
+ compositionLabel: {
348
+ fontSize: 12
349
+ },
350
+ compositionValue: {
351
+ fontSize: 15,
352
+ fontWeight: "600",
353
+ marginTop: 1
354
+ },
308
355
  savedLine: {
309
356
  flexDirection: "row",
310
357
  alignItems: "center",
@@ -567,7 +614,15 @@ function ReadingsCard({
567
614
  }], children: whenLabel(r.at, now) }),
568
615
  r.kind === "blood-pressure" && ((_a = r.problems) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsx(Text, { style: [styles.readingNote, {
569
616
  color: colors.warningText
570
- }], children: r.problems.join(" ") }) : null
617
+ }], children: r.problems.join(" ") }) : null,
618
+ r.kind === "body" && r.composition ? /* @__PURE__ */ jsx(View, { style: styles.compositionGrid, children: compositionRows(r.composition, units).map((m) => /* @__PURE__ */ jsxs(View, { style: styles.compositionItem, children: [
619
+ /* @__PURE__ */ jsx(Text, { style: [styles.compositionLabel, {
620
+ color: colors.textMuted
621
+ }], children: m.label }),
622
+ /* @__PURE__ */ jsx(Text, { style: [styles.compositionValue, {
623
+ color: colors.text
624
+ }], children: m.value })
625
+ ] }, m.label)) }) : null
571
626
  ] })
572
627
  ] }, r.id);
573
628
  }) })
@@ -772,10 +827,151 @@ function PickKind({
772
827
  ] }, k.id)) })
773
828
  ] });
774
829
  }
830
+ function formatWeight(kg, units) {
831
+ if (kg === void 0) return "--";
832
+ const v = units === "imperial" ? kg / 0.45359237 : kg;
833
+ return (Math.round(v * 10) / 10).toFixed(1);
834
+ }
835
+ function ScaleMeasuring({
836
+ colors,
837
+ live,
838
+ units
839
+ }) {
840
+ const pulse = useRef(new Animated.Value(0)).current;
841
+ useEffect(() => {
842
+ const loop = Animated.loop(Animated.timing(pulse, {
843
+ toValue: 1,
844
+ duration: 1400,
845
+ easing: Easing.out(Easing.ease),
846
+ useNativeDriver: true
847
+ }));
848
+ loop.start();
849
+ return () => loop.stop();
850
+ }, [pulse]);
851
+ const ringScale = pulse.interpolate({
852
+ inputRange: [0, 1],
853
+ outputRange: [0.9, 1.5]
854
+ });
855
+ const ringOpacity = pulse.interpolate({
856
+ inputRange: [0, 1],
857
+ outputRange: [0.5, 0]
858
+ });
859
+ const unitLabel = units === "imperial" ? "lb" : "kg";
860
+ return /* @__PURE__ */ jsxs(View, { style: styles.measureBox, children: [
861
+ /* @__PURE__ */ jsx(Animated.View, { style: [styles.measureRing, {
862
+ borderColor: colors.primary,
863
+ opacity: ringOpacity,
864
+ transform: [{
865
+ scale: ringScale
866
+ }]
867
+ }], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" }),
868
+ /* @__PURE__ */ jsx(View, { style: [styles.measureCore, {
869
+ backgroundColor: colors.primarySoft
870
+ }], children: /* @__PURE__ */ jsxs(Text, { style: [styles.measureWeight, {
871
+ color: colors.text
872
+ }], accessibilityLabel: `${formatWeight(live.weightKg, units)} ${unitLabel}`, children: [
873
+ formatWeight(live.weightKg, units),
874
+ /* @__PURE__ */ jsxs(Text, { style: [styles.measureUnit, {
875
+ color: colors.textMuted
876
+ }], children: [
877
+ " ",
878
+ unitLabel
879
+ ] })
880
+ ] }) }),
881
+ /* @__PURE__ */ jsx(Text, { style: [styles.statusTitle, {
882
+ color: colors.text
883
+ }], children: "Measuring" }),
884
+ /* @__PURE__ */ jsx(Text, { style: [styles.statusBody, {
885
+ color: colors.textMuted
886
+ }], children: "Stand still, barefoot, until it settles." })
887
+ ] });
888
+ }
889
+ function BrandLive({
890
+ kind,
891
+ colors,
892
+ live,
893
+ units
894
+ }) {
895
+ var _a, _b, _c;
896
+ const items = [];
897
+ const round1 = (n) => Math.round(n * 10) / 10;
898
+ if (kind === "kitchen-scale") items.push({
899
+ label: "Weight",
900
+ value: `${Math.round((_a = live.grams) != null ? _a : 0)} g`
901
+ });
902
+ if (kind === "tape") {
903
+ const cm = (_b = live.lengthCm) != null ? _b : 0;
904
+ items.push({
905
+ label: live.bodyPart ? live.bodyPart.replace(/_/g, " ") : "Length",
906
+ value: units === "imperial" ? `${round1(cm / 2.54)} in` : `${round1(cm)} cm`
907
+ });
908
+ }
909
+ if (kind === "jump-rope") {
910
+ items.push({
911
+ label: "Jumps",
912
+ value: String((_c = live.jumps) != null ? _c : 0)
913
+ });
914
+ if (live.elapsedS !== void 0) items.push({
915
+ label: "Time",
916
+ value: clockOf(live.elapsedS)
917
+ });
918
+ }
919
+ if (kind === "treadmill") {
920
+ if (live.speedKmh !== void 0) items.push({
921
+ label: "Speed",
922
+ value: `${round1(live.speedKmh)} km/h`
923
+ });
924
+ if (live.distanceM !== void 0) items.push({
925
+ label: "Distance",
926
+ value: `${round1(live.distanceM / 1e3)} km`
927
+ });
928
+ if (live.kcal !== void 0) items.push({
929
+ label: "Calories",
930
+ value: `${Math.round(live.kcal)} kcal`
931
+ });
932
+ if (live.elapsedS !== void 0) items.push({
933
+ label: "Time",
934
+ value: clockOf(live.elapsedS)
935
+ });
936
+ }
937
+ if (kind === "ring") {
938
+ if (live.bpm !== void 0) items.push({
939
+ label: "Heart rate",
940
+ value: `${live.bpm} bpm`
941
+ });
942
+ if (live.spo2 !== void 0) items.push({
943
+ label: "Blood oxygen",
944
+ value: `${live.spo2}%`
945
+ });
946
+ if (live.skinTempC !== void 0) items.push({
947
+ label: "Skin temp",
948
+ value: `${round1(live.skinTempC)} \xB0C`
949
+ });
950
+ if (live.steps !== void 0) items.push({
951
+ label: "Steps",
952
+ value: String(live.steps)
953
+ });
954
+ }
955
+ if (live.battery !== void 0) items.push({
956
+ label: "Battery",
957
+ value: `${live.battery}%`
958
+ });
959
+ return /* @__PURE__ */ jsx(View, { style: [styles.card, styles.livePanel, {
960
+ backgroundColor: colors.surface
961
+ }], children: /* @__PURE__ */ jsx(View, { style: styles.compositionGrid, children: items.map((m) => /* @__PURE__ */ jsxs(View, { style: styles.compositionItem, children: [
962
+ /* @__PURE__ */ jsx(Text, { style: [styles.compositionLabel, {
963
+ color: colors.textMuted
964
+ }], children: m.label }),
965
+ /* @__PURE__ */ jsx(Text, { style: [styles.compositionValue, {
966
+ color: colors.text
967
+ }], children: m.value })
968
+ ] }, m.label)) }) });
969
+ }
775
970
  function LivePanel({
776
971
  kind,
777
972
  colors,
778
973
  live,
974
+ units,
779
975
  recording,
780
976
  connected,
781
977
  onStart,
@@ -784,6 +980,12 @@ function LivePanel({
784
980
  }) {
785
981
  var _a, _b, _c, _d, _e;
786
982
  const [type, setType] = useState("run");
983
+ if (kind === "scale") {
984
+ return /* @__PURE__ */ jsx(ScaleMeasuring, { colors, live, units });
985
+ }
986
+ if (kind === "kitchen-scale" || kind === "tape" || kind === "jump-rope" || kind === "treadmill" || kind === "ring") {
987
+ return /* @__PURE__ */ jsx(BrandLive, { kind, colors, live, units });
988
+ }
787
989
  const [, tick] = useState(0);
788
990
  useEffect(() => {
789
991
  if (!recording) return void 0;
@@ -943,7 +1145,7 @@ function Measure({
943
1145
  "."
944
1146
  ] })
945
1147
  ] }) : null,
946
- (state.step === "connected" || state.step === "ended") && live ? /* @__PURE__ */ jsx(LivePanel, { kind, colors, live, recording, connected: state.step === "connected", onStart: (type) => session == null ? void 0 : session.startRecording(type), onStop: () => {
1148
+ (state.step === "connected" || state.step === "ended") && live ? /* @__PURE__ */ jsx(LivePanel, { kind, colors, live, units, recording, connected: state.step === "connected", onStart: (type) => session == null ? void 0 : session.startRecording(type), onStop: () => {
947
1149
  void (session == null ? void 0 : session.stopRecording());
948
1150
  }, onSave: () => {
949
1151
  void (session == null ? void 0 : session.saveLive());