@adminide-stack/yantra-mobile 12.0.149-alpha.2 → 12.0.149
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/lib/features/apps/mobileAppCatalog.js +2 -2
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/devices/bodyComposition.js +116 -0
- package/lib/features/devices/bodyComposition.js.map +1 -0
- package/lib/features/devices/readings.js.map +1 -1
- package/lib/features/devices/session.js +22 -2
- package/lib/features/devices/session.js.map +1 -1
- package/lib/features/dictate/DictateExperience.js +125 -8
- package/lib/features/dictate/DictateExperience.js.map +1 -1
- package/lib/features/dictate/components/DictationList.js +4 -4
- package/lib/features/dictate/components/DictationList.js.map +1 -1
- package/lib/features/dictate/components/NoteChat.js +272 -0
- package/lib/features/dictate/components/NoteChat.js.map +1 -0
- package/lib/features/dictate/components/NoteView.js +219 -86
- package/lib/features/dictate/components/NoteView.js.map +1 -1
- package/lib/features/dictate/components/Redacted.js +19 -0
- package/lib/features/dictate/components/Redacted.js.map +1 -0
- package/lib/features/dictate/dictateClient.js +177 -90
- package/lib/features/dictate/dictateClient.js.map +1 -1
- package/lib/features/dictate/dictationStore.js +2 -2
- package/lib/features/dictate/dictationStore.js.map +1 -1
- package/lib/features/dictate/kinds.js +76 -0
- package/lib/features/dictate/kinds.js.map +1 -0
- package/lib/features/dictate/noteShape.js +132 -0
- package/lib/features/dictate/noteShape.js.map +1 -0
- package/lib/features/dictate/noteText.js +8 -17
- package/lib/features/dictate/noteText.js.map +1 -1
- package/lib/features/dictate/privacy.js +68 -8
- package/lib/features/dictate/privacy.js.map +1 -1
- package/lib/features/dictate/shownNote.js +18 -9
- package/lib/features/dictate/shownNote.js.map +1 -1
- package/lib/screens/Devices/index.js +205 -3
- package/lib/screens/Devices/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privacy.js","sources":["../../../src/features/dictate/privacy.ts"],"sourcesContent":["/**\n * Placeholders in a dictation note. Before any AI reads a dictation, the\n * connector replaces each identifier (a name, a birth date, a phone number...)\n * with a placeholder such as \"[NAME_1]\" and hands back what each one stands\n * for. This phone keeps both: it shows the note with the identifiers hidden or\n * put back, and anything it sends to the AI later (suggestions) carries the\n * placeholders only.\n */\nimport type { ClinicalNote, NoteIdentifier, NoteSuggestion } from './types';\n\nconst PLACEHOLDER = /\\[[A-Z]+_\\d+\\]/g;\n\nconst LABEL: Record<string, string> = {\n NAME: 'Name',\n CLINICIAN: 'Clinician',\n FACILITY: 'Facility',\n ORG: 'Organization',\n DOB: 'Birth date',\n DATE: 'Date',\n AGE: 'Age',\n ID: 'ID',\n PHONE: 'Phone',\n EMAIL: 'Email',\n URL: 'Link',\n IP: 'IP address',\n ADDRESS: 'Address',\n};\n\n/** \"[NAME_1]\" -> \"Name 1\", how a hidden identifier reads on screen. */\nexport function placeholderLabel(token: string): string {\n const m = /^\\[([A-Z]+)_(\\d+)\\]$/.exec(token);\n if (!m) return token;\n return `${LABEL[m[1]] ?? m[1].charAt(0) + m[1].slice(1).toLowerCase()} ${m[2]}`;\n}\n\n/** The text in runs, each placeholder its own run, for drawing them apart. */\nexport function splitPlaceholders(text: string): Array<{ text: string; placeholder: boolean }> {\n const runs: Array<{ text: string; placeholder: boolean }> = [];\n let last = 0;\n for (const m of text.matchAll(PLACEHOLDER)) {\n const at = m.index ?? 0;\n if (at > last) runs.push({ text: text.slice(last, at), placeholder: false });\n runs.push({ text: m[0], placeholder: true });\n last = at + m[0].length;\n }\n if (last < text.length) runs.push({ text: text.slice(last), placeholder: false });\n return runs;\n}\n\n/** Each placeholder put back to what it stands for; one this phone does not know stays. */\nexport function restoreText(text: string, identifiers: NoteIdentifier[]): string {\n const byToken = new Map(identifiers.map((id) => [id.token, id.value]));\n return text.replace(PLACEHOLDER, (token) => byToken.get(token) ?? token);\n}\n\n/** Each placeholder as its label in brackets, for text that leaves the phone hidden (\"[Name 1]\"). */\nexport function labelText(text: string): string {\n return text.replace(PLACEHOLDER, (token) => `[${placeholderLabel(token)}]`);\n}\n\nexport function mapNote(note: ClinicalNote, fn: (text: string) => string): ClinicalNote {\n return {\n title: fn(note.title),\n subjective: note.subjective.map(fn),\n objective: note.objective.map(fn),\n assessment: note.assessment.map(fn),\n plan: note.plan.map(fn),\n medications: note.medications.map((m) => ({\n ...m,\n name: fn(m.name),\n dose: fn(m.dose),\n route: fn(m.route),\n frequency: fn(m.frequency),\n })),\n follow_up: fn(note.follow_up),\n to_verify: note.to_verify.map(fn),\n };\n}\n\nexport function mapSuggestions(items: NoteSuggestion[], fn: (text: string) => string): NoteSuggestion[] {\n return items.map((s) => ({ ...s, text: fn(s.text), why: fn(s.why) }));\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AASA,MAAM,WAAc,GAAA,iBAAA;AACpB,MAAM,KAAgC,GAAA;AAAA,EACpC,IAAM,EAAA,MAAA;AAAA,EACN,SAAW,EAAA,WAAA;AAAA,EACX,QAAU,EAAA,UAAA;AAAA,EACV,GAAK,EAAA,cAAA;AAAA,EACL,GAAK,EAAA,YAAA;AAAA,EACL,IAAM,EAAA,MAAA;AAAA,EACN,GAAK,EAAA,KAAA;AAAA,EACL,EAAI,EAAA,IAAA;AAAA,EACJ,KAAO,EAAA,OAAA;AAAA,EACP,KAAO,EAAA,OAAA;AAAA,EACP,GAAK,EAAA,MAAA;AAAA,EACL,EAAI,EAAA,YAAA;AAAA,EACJ,OAAS,EAAA;AACX,CAAA;AAGO,SAAS,iBAAiB,KAAuB,EAAA;AA3BxD,EAAA,IAAA,EAAA;AA4BE,EAAM,MAAA,CAAA,GAAI,sBAAuB,CAAA,IAAA,CAAK,KAAK,CAAA;AAC3C,EAAI,IAAA,CAAC,GAAU,OAAA,KAAA;AACf,EAAO,OAAA,CAAA,EAAA,CAAG,EAAM,GAAA,KAAA,CAAA,CAAA,CAAE,CAAC,CAAC,MAAV,IAAe,GAAA,EAAA,GAAA,CAAA,CAAE,CA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CAAK,SAAS,CAAA;AAAA,IAC5B,SAAW,EAAA,IAAA,CAAK,SAAU,CAAA,GAAA,CAAI,EAAE;AAAA,GAClC;AACF;AACgB,SAAA,cAAA,CAAe,OAAyB,EAAgD,EAAA;AACtG,EAAA,OAAO,KAAM,CAAA,GAAA,CAAI,CAAM,CAAA,KAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EAClB,CADkB,CAAA,EAAA;AAAA,IAErB,IAAA,EAAM,EAAG,CAAA,CAAA,CAAE,IAAI,CAAA;AAAA,IACf,GAAA,EAAK,EAAG,CAAA,CAAA,CAAE,GAAG;AAAA,GACb,CAAA,CAAA;AACJ"}
|
|
1
|
+
{"version":3,"file":"privacy.js","sources":["../../../src/features/dictate/privacy.ts"],"sourcesContent":["/**\n * Placeholders in a dictation note. Before any AI reads a dictation, the\n * connector replaces each identifier (a name, a birth date, a phone number...)\n * with a placeholder such as \"[NAME_1]\" and hands back what each one stands\n * for. This phone keeps both: it shows the note with the identifiers hidden or\n * put back, and anything it sends to the AI later (suggestions, a chat message)\n * carries the placeholders only - a name typed into the chat that the note\n * already knows is swapped for its placeholder here, before it leaves.\n */\nimport type { ChatTurn, DictationNote, DictationRecord, NoteIdentifier, NoteSuggestion } from './types';\n\nconst PLACEHOLDER = /\\[[A-Z]+_\\d+\\]/g;\n\nconst LABEL: Record<string, string> = {\n NAME: 'Name',\n CLINICIAN: 'Clinician',\n FACILITY: 'Facility',\n ORG: 'Organization',\n DOB: 'Birth date',\n DATE: 'Date',\n AGE: 'Age',\n ID: 'ID',\n PHONE: 'Phone',\n EMAIL: 'Email',\n URL: 'Link',\n IP: 'IP address',\n ADDRESS: 'Address',\n};\n\n/** \"[NAME_1]\" -> \"Name 1\", how a hidden identifier reads on screen. */\nexport function placeholderLabel(token: string): string {\n const m = /^\\[([A-Z]+)_(\\d+)\\]$/.exec(token);\n if (!m) return token;\n return `${LABEL[m[1]] ?? m[1].charAt(0) + m[1].slice(1).toLowerCase()} ${m[2]}`;\n}\n\n/** The text in runs, each placeholder its own run, for drawing them apart. */\nexport function splitPlaceholders(text: string): Array<{ text: string; placeholder: boolean }> {\n const runs: Array<{ text: string; placeholder: boolean }> = [];\n let last = 0;\n for (const m of text.matchAll(PLACEHOLDER)) {\n const at = m.index ?? 0;\n if (at > last) runs.push({ text: text.slice(last, at), placeholder: false });\n runs.push({ text: m[0], placeholder: true });\n last = at + m[0].length;\n }\n if (last < text.length) runs.push({ text: text.slice(last), placeholder: false });\n return runs;\n}\n\n/** Each placeholder put back to what it stands for; one this phone does not know stays. */\nexport function restoreText(text: string, identifiers: NoteIdentifier[]): string {\n const byToken = new Map(identifiers.map((id) => [id.token, id.value]));\n return text.replace(PLACEHOLDER, (token) => byToken.get(token) ?? token);\n}\n\n/** Each placeholder as its label in brackets, for text that leaves the phone hidden (\"[Name 1]\"). */\nexport function labelText(text: string): string {\n return text.replace(PLACEHOLDER, (token) => `[${placeholderLabel(token)}]`);\n}\n\nexport function mapNote(note: DictationNote, fn: (text: string) => string): DictationNote {\n return {\n ...note,\n title: fn(note.title),\n summary: fn(note.summary),\n sections: note.sections.map((s) => ({ heading: fn(s.heading), items: s.items.map(fn) })),\n actions: note.actions.map(fn),\n medications: note.medications.map((m) => ({\n ...m,\n name: fn(m.name),\n dose: fn(m.dose),\n route: fn(m.route),\n frequency: fn(m.frequency),\n })),\n to_verify: note.to_verify.map(fn),\n };\n}\n\nexport function mapSuggestions(items: NoteSuggestion[], fn: (text: string) => string): NoteSuggestion[] {\n return items.map((s) => ({ ...s, text: fn(s.text), why: fn(s.why) }));\n}\n\nexport function mapTurns(turns: ChatTurn[], fn: (text: string) => string): ChatTurn[] {\n return turns.map((t) => ({ ...t, text: fn(t.text) }));\n}\n\n/** Every placeholder this dictation has handed out, and what it stands for: the note's, the suggestions', the chat's. */\nexport function knownIdentifiers(record: DictationRecord): NoteIdentifier[] {\n const seen = new Set<string>();\n return [\n ...(record.redaction?.identifiers ?? []),\n ...(record.suggestions?.identifiers ?? []),\n ...(record.chat?.identifiers ?? []),\n ].filter((id) => !seen.has(id.token) && !!seen.add(id.token));\n}\n\nconst escapeRe = (s: string) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n/**\n * A whole word (or run of words): no letter or digit on either side. Built in\n * a try, never as a literal: an engine without Unicode property escapes gets\n * ASCII plus Latin letters instead (Hermes-safe, as in canvas/templateSearch).\n */\nfunction wordRe(value: string, ignoreCase: boolean): RegExp {\n const flags = ignoreCase ? 'gi' : 'g';\n try {\n return new RegExp(`(^|[^\\\\p{L}\\\\p{N}_])(${escapeRe(value)})(?![\\\\p{L}\\\\p{N}_])`, `${flags}u`);\n } catch {\n return new RegExp(`(^|[^A-Za-z0-9_\\\\u00C0-\\\\u024F])(${escapeRe(value)})(?![A-Za-z0-9_\\\\u00C0-\\\\u024F])`, flags);\n }\n}\n\n/** Words in a name that never name the person on their own. */\nconst NOT_A_NAME = new Set([\n 'dr',\n 'doctor',\n 'mr',\n 'mrs',\n 'ms',\n 'miss',\n 'mx',\n 'prof',\n 'professor',\n 'nurse',\n 'the',\n 'and',\n 'of',\n]);\nconst capitalised = (word: string) => word[0] !== word[0].toLowerCase();\n\n/** A number's digits however it is written: \"(404) 555-0182\", \"404-555-0182\" or \"404.555.0182\". */\nconst digitsRe = (digits: string) => new RegExp(`(^|[^0-9])(\\\\(?${digits.split('').join('[\\\\s().-]*')})(?![0-9])`, 'g');\n/** Fewer digits than this could be anything (a dose, a page); more is a number that identifies. */\nconst MIN_ID_DIGITS = 6;\n\n/**\n * Text with every name and number this dictation already knows swapped for\n * its placeholder: each value as heard (any case), a number by its digits\n * however it is typed, and a person's first or last name alone when\n * capitalised (\"Carter\" for [NAME_1] = John Carter). Longest first, so\n * \"John Carter\" is one placeholder, not two.\n */\nexport function hideKnown(text: string, identifiers: NoteIdentifier[]): { text: string; hidden: number } {\n const swaps = identifiers\n .map((id) => ({ ...id, value: id.value.trim() }))\n .filter((id) => id.value.length >= 2)\n .flatMap((id) => {\n const whole = { size: id.value.length, token: id.token, re: wordRe(id.value, true) };\n const digits = id.value.replace(/\\D/g, '');\n if (digits.length >= MIN_ID_DIGITS) return [whole, { ...whole, re: digitsRe(digits) }];\n if (id.kind !== 'name' && id.kind !== 'clinician') return [whole];\n const parts = id.value\n .split(/\\s+/)\n .map((part) => part.replace(/[.,]/g, ''))\n .filter((word) => word.length >= 3 && capitalised(word) && !NOT_A_NAME.has(word.toLowerCase()))\n .map((word) => ({ size: word.length, token: id.token, re: wordRe(word, false) }));\n return [whole, ...parts];\n })\n .sort((a, b) => b.size - a.size);\n return swaps.reduce(\n (acc, swap) => {\n let hidden = 0;\n const out = acc.text.replace(swap.re, (_m, before: string) => {\n hidden += 1;\n return `${before}${swap.token}`;\n });\n return { text: out, hidden: acc.hidden + hidden };\n },\n { text, hidden: 0 },\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,MAAM,WAAc,GAAA,iBAAA;AACpB,MAAM,KAAgC,GAAA;AAAA,EACpC,IAAM,EAAA,MAAA;AAAA,EACN,SAAW,EAAA,WAAA;AAAA,EACX,QAAU,EAAA,UAAA;AAAA,EACV,GAAK,EAAA,cAAA;AAAA,EACL,GAAK,EAAA,YAAA;AAAA,EACL,IAAM,EAAA,MAAA;AAAA,EACN,GAAK,EAAA,KAAA;AAAA,EACL,EAAI,EAAA,IAAA;AAAA,EACJ,KAAO,EAAA,OAAA;AAAA,EACP,KAAO,EAAA,OAAA;AAAA,EACP,GAAK,EAAA,MAAA;AAAA,EACL,EAAI,EAAA,YAAA;AAAA,EACJ,OAAS,EAAA;AACX,CAAA;AAGO,SAAS,iBAAiB,KAAuB,EAAA;AA5BxD,EAAA,IAAA,EAAA;AA6BE,EAAM,MAAA,CAAA,GAAI,sBAAuB,CAAA,IAAA,CAAK,KAAK,CAAA;AAC3C,EAAI,IAAA,CAAC,GAAU,OAAA,KAAA;AACf,EAAO,OAAA,CAAA,EAAA,CAAG,EAAM,GAAA,KAAA,CAAA,CAA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AAA;AAAA,MACnL,MAAM,IAAK,CAAA,MAAA;AAAA,MACX,OAAO,EAAG,CAAA,KAAA;AAAA,MACV,EAAA,EAAI,MAAO,CAAA,IAAA,EAAM,KAAK;AAAA,KACtB,CAAA,CAAA;AACF,IAAO,OAAA,CAAC,KAAO,EAAA,GAAG,KAAK,CAAA;AAAA,GACxB,EAAE,IAAK,CAAA,CAAC,GAAG,CAAM,KAAA,CAAA,CAAE,IAAO,GAAA,CAAA,CAAE,IAAI,CAAA;AACjC,EAAA,OAAO,KAAM,CAAA,MAAA,CAAO,CAAC,GAAA,EAAK,IAAS,KAAA;AACjC,IAAA,IAAI,MAAS,GAAA,CAAA;AACb,IAAM,MAAA,GAAA,GAAM,IAAI,IAAK,CAAA,OAAA,CAAQ,KAAK,EAAI,EAAA,CAAC,IAAI,MAAmB,KAAA;AAC5D,MAAU,MAAA,IAAA,CAAA;AACV,MAAA,OAAO,CAAG,EAAA,MAAM,CAAG,EAAA,IAAA,CAAK,KAAK,CAAA,CAAA;AAAA,KAC9B,CAAA;AACD,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,GAAA;AAAA,MACN,MAAA,EAAQ,IAAI,MAAS,GAAA;AAAA,KACvB;AAAA,GACC,EAAA;AAAA,IACD,IAAA;AAAA,IACA,MAAQ,EAAA;AAAA,GACT,CAAA;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {knownIdentifiers,restoreText,mapTurns,mapSuggestions,mapNote}from'./privacy.js';function shownNote(record, note, showIdentifiers) {
|
|
2
2
|
var _a, _b, _c, _d, _e, _f;
|
|
3
3
|
const {
|
|
4
4
|
redaction
|
|
@@ -6,19 +6,28 @@ import {mapSuggestions,restoreText,mapNote}from'./privacy.js';function shownNote
|
|
|
6
6
|
if (!redaction) return {
|
|
7
7
|
note,
|
|
8
8
|
transcript: (_a = record.transcript) != null ? _a : "",
|
|
9
|
-
suggestions: null
|
|
9
|
+
suggestions: null,
|
|
10
|
+
turns: [],
|
|
11
|
+
show: (t) => t
|
|
10
12
|
};
|
|
11
13
|
const items = (_c = (_b = record.suggestions) == null ? void 0 : _b.items) != null ? _c : null;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const turns = (_e = (_d = record.chat) == null ? void 0 : _d.turns) != null ? _e : [];
|
|
15
|
+
if (!showIdentifiers) {
|
|
16
|
+
return {
|
|
17
|
+
note: redaction.note,
|
|
18
|
+
transcript: redaction.transcript,
|
|
19
|
+
suggestions: items,
|
|
20
|
+
turns,
|
|
21
|
+
show: (t) => t
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const identifiers = knownIdentifiers(record);
|
|
18
25
|
const restore = (text) => restoreText(text, identifiers);
|
|
19
26
|
return {
|
|
20
27
|
note: mapNote(redaction.note, restore),
|
|
21
28
|
transcript: (_f = record.transcript) != null ? _f : restore(redaction.transcript),
|
|
22
|
-
suggestions: items ? mapSuggestions(items, restore) : null
|
|
29
|
+
suggestions: items ? mapSuggestions(items, restore) : null,
|
|
30
|
+
turns: mapTurns(turns, restore),
|
|
31
|
+
show: restore
|
|
23
32
|
};
|
|
24
33
|
}export{shownNote};//# sourceMappingURL=shownNote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shownNote.js","sources":["../../../src/features/dictate/shownNote.ts"],"sourcesContent":["/**\n * The note as the
|
|
1
|
+
{"version":3,"file":"shownNote.js","sources":["../../../src/features/dictate/shownNote.ts"],"sourcesContent":["/**\n * The note as the person chose to see it: identifiers hidden (what the AI\n * saw) or put back - the note, its suggestions and the chat about it alike. A\n * note written before identifiers were hidden has only the one version.\n */\nimport { knownIdentifiers, mapNote, mapSuggestions, mapTurns, restoreText } from './privacy';\nimport type { ChatTurn, DictationNote, DictationRecord, NoteSuggestion } from './types';\n\nexport type SuggestState = { status: 'idle' } | { status: 'loading' } | { status: 'error'; message: string };\n\n/** The chat's request in flight, or the one that failed (kept so it can be sent again). */\nexport type AskState =\n | { status: 'idle' }\n | { status: 'loading'; text: string }\n | { status: 'error'; text: string; message: string };\n\n/** A rewrite as another kind, in flight or failed. */\nexport type RewriteState = { status: 'idle' } | { status: 'loading' } | { status: 'error'; message: string };\n\nexport interface ShownNote {\n note: DictationNote;\n transcript: string;\n /** null until suggestions were asked for (and always for a note written before hiding). */\n suggestions: NoteSuggestion[] | null;\n turns: ChatTurn[];\n /** Text the AI saw, as this screen shows it. */\n show: (text: string) => string;\n}\n\nexport function shownNote(record: DictationRecord, note: DictationNote, showIdentifiers: boolean): ShownNote {\n const { redaction } = record;\n if (!redaction) return { note, transcript: record.transcript ?? '', suggestions: null, turns: [], show: (t) => t };\n const items = record.suggestions?.items ?? null;\n const turns = record.chat?.turns ?? [];\n if (!showIdentifiers) {\n return { note: redaction.note, transcript: redaction.transcript, suggestions: items, turns, show: (t) => t };\n }\n const identifiers = knownIdentifiers(record);\n const restore = (text: string) => restoreText(text, identifiers);\n return {\n note: mapNote(redaction.note, restore),\n transcript: record.transcript ?? restore(redaction.transcript),\n suggestions: items ? mapSuggestions(items, restore) : null,\n turns: mapTurns(turns, restore),\n show: restore,\n };\n}\n"],"names":[],"mappings":"wFA8CgB,SAAA,SAAA,CAAU,MAAyB,EAAA,IAAA,EAAqB,eAAqC,EAAA;AA9C7G,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AA+CE,EAAM,MAAA;AAAA,IACJ;AAAA,GACE,GAAA,MAAA;AACJ,EAAI,IAAA,CAAC,WAAkB,OAAA;AAAA,IACrB,IAAA;AAAA,IACA,UAAA,EAAA,CAAY,EAAO,GAAA,MAAA,CAAA,UAAA,KAAP,IAAqB,GAAA,EAAA,GAAA,EAAA;AAAA,IACjC,WAAa,EAAA,IAAA;AAAA,IACb,OAAO,EAAC;AAAA,IACR,MAAM,CAAK,CAAA,KAAA;AAAA,GACb;AACA,EAAA,MAAM,KAAQ,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAA,CAAO,WAAP,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAoB,UAApB,IAA6B,GAAA,EAAA,GAAA,IAAA;AAC3C,EAAA,MAAM,SAAQ,EAAO,GAAA,CAAA,EAAA,GAAA,MAAA,CAAA,IAAA,KAAP,IAAa,GAAA,MAAA,GAAA,EAAA,CAAA,KAAA,KAAb,YAAsB,EAAC;AACrC,EAAA,IAAI,CAAC,eAAiB,EAAA;AACpB,IAAO,OAAA;AAAA,MACL,MAAM,SAAU,CAAA,IAAA;AAAA,MAChB,YAAY,SAAU,CAAA,UAAA;AAAA,MACtB,WAAa,EAAA,KAAA;AAAA,MACb,KAAA;AAAA,MACA,MAAM,CAAK,CAAA,KAAA;AAAA,KACb;AAAA;AAEF,EAAM,MAAA,WAAA,GAAc,iBAAiB,MAAM,CAAA;AAC3C,EAAA,MAAM,OAAU,GAAA,CAAC,IAAiB,KAAA,WAAA,CAAY,MAAM,WAAW,CAAA;AAC/D,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,OAAA,CAAQ,SAAU,CAAA,IAAA,EAAM,OAAO,CAAA;AAAA,IACrC,aAAY,EAAO,GAAA,MAAA,CAAA,UAAA,KAAP,IAAqB,GAAA,EAAA,GAAA,OAAA,CAAQ,UAAU,UAAU,CAAA;AAAA,IAC7D,WAAa,EAAA,KAAA,GAAQ,cAAe,CAAA,KAAA,EAAO,OAAO,CAAI,GAAA,IAAA;AAAA,IACtD,KAAA,EAAO,QAAS,CAAA,KAAA,EAAO,OAAO,CAAA;AAAA,IAC9B,IAAM,EAAA;AAAA,GACR;AACF"}
|
|
@@ -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());
|