@burdenoff/microfe-healthybowl 2026.902.14 → 2026.902.16

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 (36) hide show
  1. package/dist/components/assistant/AssistantAutoSpeakToggle.js +4 -27
  2. package/dist/components/assistant/AssistantHeader.js +38 -42
  3. package/dist/components/assistant/AssistantHeader.js.map +1 -1
  4. package/dist/components/assistant/AssistantMoreMenu.js +121 -0
  5. package/dist/components/assistant/AssistantMoreMenu.js.map +1 -0
  6. package/dist/components/assistant/AssistantSpeechProvider.js +176 -161
  7. package/dist/components/assistant/AssistantSpeechProvider.js.map +1 -1
  8. package/dist/components/assistant/index.js +2 -2
  9. package/dist/healthybowl/hooks/useConsultationPayments.js +59 -0
  10. package/dist/healthybowl/hooks/useConsultationPayments.js.map +1 -0
  11. package/dist/healthybowl/hooks/useHealthyBowlData.js +15 -0
  12. package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
  13. package/dist/healthybowl/offline/graphql.js.map +1 -1
  14. package/dist/healthybowl/offline/syncEngine.js +2 -1
  15. package/dist/healthybowl/offline/syncEngine.js.map +1 -1
  16. package/dist/healthybowl/offline/types.js.map +1 -1
  17. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +228 -188
  18. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js.map +1 -1
  19. package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js +261 -191
  20. package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js.map +1 -1
  21. package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js +49 -0
  22. package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js.map +1 -0
  23. package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js +48 -0
  24. package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js.map +1 -0
  25. package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js +54 -0
  26. package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js.map +1 -0
  27. package/dist/healthybowl/pages/network/ExpertsPage.js +520 -419
  28. package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
  29. package/dist/hooks/useAssistantKeyboardShortcuts.js +1 -1
  30. package/dist/hooks/useAssistantKeyboardShortcuts.js.map +1 -1
  31. package/dist/utils/voicePreview.js +28 -0
  32. package/dist/utils/voicePreview.js.map +1 -0
  33. package/package.json +1 -1
  34. package/dist/components/assistant/AssistantAutoSpeakToggle.js.map +0 -1
  35. package/dist/components/assistant/AssistantExportMenu.js +0 -52
  36. package/dist/components/assistant/AssistantExportMenu.js.map +0 -1
@@ -1,27 +1,4 @@
1
- import { useTr as e } from "../../shared/hooks/useTr.js";
2
- import { useAssistantSpeech as t } from "./AssistantSpeechProvider.js";
3
- import { Volume2 as n, VolumeX as r } from "lucide-react";
4
- import { jsx as i } from "react/jsx-runtime";
5
- //#region src/components/assistant/AssistantAutoSpeakToggle.tsx
6
- var a = () => {
7
- let a = e(), { isSupported: o, isBlocked: s, disabledReason: c, autoSpeakEnabled: l, setAutoSpeak: u, stop: d } = t();
8
- if (!o) return null;
9
- let f = s && !l, p = l ? a("healthybowl.assistant.header.autoSpeakOff", "Stop reading replies aloud") : a("healthybowl.assistant.header.autoSpeakOn", "Read replies aloud automatically");
10
- return /* @__PURE__ */ i("button", {
11
- type: "button",
12
- onClick: () => {
13
- l && d(), u(!l);
14
- },
15
- disabled: f,
16
- className: `rounded-lg p-1.5 transition-colors disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent ${l ? "bg-action-primary-bg/15 text-action-primary-bg" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
17
- title: f ? c ?? p : p,
18
- "aria-label": p,
19
- "aria-pressed": l,
20
- "data-testid": "assistant-auto-speak",
21
- children: i(l ? n : r, { className: "size-4" })
22
- });
23
- };
24
- //#endregion
25
- export { a as AssistantAutoSpeakToggle };
26
-
27
- //# sourceMappingURL=AssistantAutoSpeakToggle.js.map
1
+ import "../../shared/hooks/useTr.js";
2
+ import "./AssistantSpeechProvider.js";
3
+ import "lucide-react";
4
+ import "react/jsx-runtime";
@@ -1,81 +1,77 @@
1
1
  import { useTr as e } from "../../shared/hooks/useTr.js";
2
- import { AssistantExportMenu as t } from "./AssistantExportMenu.js";
3
- import { AssistantAutoSpeakToggle as n } from "./AssistantAutoSpeakToggle.js";
4
- import { AssistantVoiceSelector as r } from "./composer/AssistantVoiceSelector.js";
5
- import { History as i, PanelBottom as a, PanelRight as o, Plus as s, Sparkles as c, X as l } from "lucide-react";
6
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
2
+ import { AssistantMoreMenu as t } from "./AssistantMoreMenu.js";
3
+ import { History as n, PanelBottom as r, PanelRight as i, Plus as a, Sparkles as o, X as s } from "lucide-react";
4
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
5
  //#region src/components/assistant/AssistantHeader.tsx
8
- var f = ({ contextLabel: f, onNewConversation: p, onOpenHistory: m, historyOpen: h, onClose: g, docked: _, onToggleDock: v }) => {
9
- let y = e();
10
- return /* @__PURE__ */ d("div", {
6
+ var u = ({ contextLabel: u, onNewConversation: d, onOpenHistory: f, historyOpen: p, onClose: m, docked: h, onToggleDock: g }) => {
7
+ let _ = e();
8
+ return /* @__PURE__ */ l("div", {
11
9
  className: "flex items-center gap-2 border-b border-border-default bg-bg-elevated px-3 py-2.5",
12
- children: [/* @__PURE__ */ d("div", {
10
+ children: [/* @__PURE__ */ l("div", {
13
11
  className: "flex min-w-0 flex-1 items-center gap-2",
14
- children: [/* @__PURE__ */ u("span", {
12
+ children: [/* @__PURE__ */ c("span", {
15
13
  className: "flex size-7 flex-shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-action-primary-bg/25 to-action-primary-bg/5 text-action-primary-bg",
16
- children: /* @__PURE__ */ u(c, { className: "size-4" })
17
- }), /* @__PURE__ */ d("span", {
14
+ children: /* @__PURE__ */ c(o, { className: "size-4" })
15
+ }), /* @__PURE__ */ l("span", {
18
16
  className: "min-w-0 flex-1",
19
- children: [/* @__PURE__ */ u("span", {
17
+ children: [/* @__PURE__ */ c("span", {
20
18
  className: "block truncate text-[14px] font-semibold leading-tight text-text-primary",
21
- children: y("healthybowl.assistant.header.title", "HealthyBowl AI")
22
- }), /* @__PURE__ */ d("span", {
19
+ children: _("healthybowl.assistant.header.title", "HealthyBowl AI")
20
+ }), /* @__PURE__ */ l("span", {
23
21
  className: "block truncate text-[11px] leading-tight text-text-muted",
24
22
  children: [
25
- y("healthybowl.assistant.header.ready", "Ready"),
26
- /* @__PURE__ */ u("span", {
23
+ _("healthybowl.assistant.header.ready", "Ready"),
24
+ /* @__PURE__ */ c("span", {
27
25
  "aria-hidden": "true",
28
26
  children: " · "
29
27
  }),
30
- y("healthybowl.assistant.header.context", "Context: {{page}}", { page: f })
28
+ _("healthybowl.assistant.header.context", "Context: {{page}}", { page: u })
31
29
  ]
32
30
  })]
33
31
  })]
34
- }), /* @__PURE__ */ d("div", {
32
+ }), /* @__PURE__ */ l("div", {
35
33
  className: "flex flex-shrink-0 items-center gap-0.5",
36
34
  children: [
37
- /* @__PURE__ */ u("button", {
35
+ /* @__PURE__ */ c("button", {
38
36
  type: "button",
39
- onClick: p,
37
+ onClick: d,
40
38
  className: "rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
41
- "aria-label": y("healthybowl.assistant.header.newConversation", "New conversation"),
39
+ "aria-label": _("healthybowl.assistant.header.newConversation", "New conversation"),
42
40
  "data-testid": "assistant-new-conversation",
43
- children: /* @__PURE__ */ u(s, { className: "size-4" })
41
+ children: /* @__PURE__ */ c(a, { className: "size-4" })
44
42
  }),
45
- /* @__PURE__ */ u("button", {
43
+ /* @__PURE__ */ c("button", {
46
44
  type: "button",
47
- onClick: m,
48
- className: `rounded-lg p-1.5 transition-colors ${h ? "bg-action-primary-bg/15 text-action-primary-bg" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
49
- "aria-label": y("healthybowl.assistant.header.history", "Conversation history"),
50
- "aria-pressed": h,
45
+ onClick: f,
46
+ className: `rounded-lg p-1.5 transition-colors ${p ? "bg-action-primary-bg/15 text-action-primary-bg" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
47
+ "aria-label": _("healthybowl.assistant.header.history", "Conversation history"),
48
+ "aria-pressed": p,
51
49
  "data-testid": "assistant-open-history",
52
- children: /* @__PURE__ */ u(i, { className: "size-4" })
50
+ children: /* @__PURE__ */ c(n, { className: "size-4" })
53
51
  }),
54
- /* @__PURE__ */ u(n, {}),
55
- /* @__PURE__ */ u(r, {}),
56
- /* @__PURE__ */ u(t, {}),
57
- v && /* @__PURE__ */ u("button", {
52
+ /* @__PURE__ */ c(t, {}),
53
+ g && /* @__PURE__ */ c("button", {
58
54
  type: "button",
59
- onClick: v,
55
+ onClick: g,
60
56
  className: "hidden rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary md:inline-flex",
61
- "aria-label": _ ? y("healthybowl.assistant.header.float", "Float chat window") : y("healthybowl.assistant.header.dock", "Dock to side panel"),
62
- "aria-pressed": _,
57
+ "aria-label": h ? _("healthybowl.assistant.header.float", "Float chat window") : _("healthybowl.assistant.header.dock", "Dock to side panel"),
58
+ "aria-pressed": h,
63
59
  "data-testid": "assistant-toggle-dock",
64
- children: u(_ ? a : o, { className: "size-4" })
60
+ children: c(h ? r : i, { className: "size-4" })
65
61
  }),
66
- /* @__PURE__ */ u("button", {
62
+ /* @__PURE__ */ c("button", {
67
63
  type: "button",
68
- onClick: g,
64
+ onClick: m,
69
65
  className: "rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
70
- "aria-label": y("healthybowl.assistant.header.close", "Close assistant"),
66
+ "aria-label": _("healthybowl.assistant.header.close", "Close assistant"),
71
67
  "data-testid": "assistant-close",
72
- children: /* @__PURE__ */ u(l, { className: "size-4" })
68
+ children: /* @__PURE__ */ c(s, { className: "size-4" })
73
69
  })
74
70
  ]
75
71
  })]
76
72
  });
77
73
  };
78
74
  //#endregion
79
- export { f as AssistantHeader };
75
+ export { u as AssistantHeader };
80
76
 
81
77
  //# sourceMappingURL=AssistantHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantHeader.js","names":[],"sources":["../../../src/components/assistant/AssistantHeader.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Sparkles, Plus, History, PanelRight, PanelBottom, X } from 'lucide-react';\nimport { AssistantExportMenu } from './AssistantExportMenu';\nimport { AssistantAutoSpeakToggle } from './AssistantAutoSpeakToggle';\nimport { AssistantVoiceSelector } from './composer/AssistantVoiceSelector';\nimport { useTr } from '../../shared/hooks/useTr';\n\ninterface Props {\n /** Friendly label for the page the user is on (e.g. \"Inventory\"). */\n contextLabel: string;\n onNewConversation: () => void;\n onOpenHistory: () => void;\n /** True when the history drawer is currently open (drives the toggle state). */\n historyOpen: boolean;\n onClose: () => void;\n docked?: boolean;\n onToggleDock?: () => void;\n}\n\n/**\n * AssistantHeader — the v2 identity bar (per the ai-assistant-v2 mockups):\n * a ✦ brand mark + \"HealthyBowl AI\", a small availability/context subtitle\n * (\"Ready · Context: <page>\"), and a row of icon actions: New conversation,\n * History (opens the conversation list as an overlay drawer — NOT an accordion),\n * Export, Dock toggle, Close.\n *\n * Replaces the old \"Conversation History\" accordion header. HB semantic tokens\n * only; copy via useTr.\n */\nexport const AssistantHeader: FC<Props> = ({\n contextLabel,\n onNewConversation,\n onOpenHistory,\n historyOpen,\n onClose,\n docked,\n onToggleDock,\n}) => {\n const tr = useTr();\n\n return (\n <div className=\"flex items-center gap-2 border-b border-border-default bg-bg-elevated px-3 py-2.5\">\n {/* Brand + context subtitle */}\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n <span className=\"flex size-7 flex-shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-action-primary-bg/25 to-action-primary-bg/5 text-action-primary-bg\">\n <Sparkles className=\"size-4\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-[14px] font-semibold leading-tight text-text-primary\">\n {tr('healthybowl.assistant.header.title', 'HealthyBowl AI')}\n </span>\n <span className=\"block truncate text-[11px] leading-tight text-text-muted\">\n {tr('healthybowl.assistant.header.ready', 'Ready')}\n <span aria-hidden=\"true\"> · </span>\n {tr('healthybowl.assistant.header.context', 'Context: {{page}}', { page: contextLabel })}\n </span>\n </span>\n </div>\n\n {/* Actions */}\n <div className=\"flex flex-shrink-0 items-center gap-0.5\">\n <button\n type=\"button\"\n onClick={onNewConversation}\n className=\"rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n aria-label={tr('healthybowl.assistant.header.newConversation', 'New conversation')}\n data-testid=\"assistant-new-conversation\"\n >\n <Plus className=\"size-4\" />\n </button>\n <button\n type=\"button\"\n onClick={onOpenHistory}\n className={`rounded-lg p-1.5 transition-colors ${\n historyOpen\n ? 'bg-action-primary-bg/15 text-action-primary-bg'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n }`}\n aria-label={tr('healthybowl.assistant.header.history', 'Conversation history')}\n aria-pressed={historyOpen}\n data-testid=\"assistant-open-history\"\n >\n <History className=\"size-4\" />\n </button>\n {/* Renders nothing where the browser has no speech output. */}\n <AssistantAutoSpeakToggle />\n {/* Beside the auto-speak toggle rather than in the composer: it is a\n playback setting, and the composer row is already exactly full at\n 390px — a fourth chip there would push send off the edge. Renders\n nothing when the device offers fewer than two voices. */}\n <AssistantVoiceSelector />\n <AssistantExportMenu />\n {onToggleDock && (\n <button\n type=\"button\"\n onClick={onToggleDock}\n className=\"hidden rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary md:inline-flex\"\n aria-label={\n docked\n ? tr('healthybowl.assistant.header.float', 'Float chat window')\n : tr('healthybowl.assistant.header.dock', 'Dock to side panel')\n }\n aria-pressed={docked}\n data-testid=\"assistant-toggle-dock\"\n >\n {docked ? <PanelBottom className=\"size-4\" /> : <PanelRight className=\"size-4\" />}\n </button>\n )}\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n aria-label={tr('healthybowl.assistant.header.close', 'Close assistant')}\n data-testid=\"assistant-close\"\n >\n <X className=\"size-4\" />\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;AA6BA,IAAa,KAA8B,EACzC,iBACA,sBACA,kBACA,gBACA,YACA,WACA,sBACI;CACJ,IAAM,IAAK,EAAM;CAEjB,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CAEE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cACd,kBAAC,GAAD,EAAU,WAAU,SAAU,CAAA;GAC1B,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;cAAhB,CACE,kBAAC,QAAD;KAAM,WAAU;eACb,EAAG,sCAAsC,gBAAgB;IACtD,CAAA,GACN,kBAAC,QAAD;KAAM,WAAU;eAAhB;MACG,EAAG,sCAAsC,OAAO;MACjD,kBAAC,QAAD;OAAM,eAAY;iBAAO;MAAS,CAAA;MACjC,EAAG,wCAAwC,qBAAqB,EAAE,MAAM,EAAa,CAAC;KACnF;MACF;KACH;MAGL,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cAAY,EAAG,gDAAgD,kBAAkB;KACjF,eAAY;eAEZ,kBAAC,GAAD,EAAM,WAAU,SAAU,CAAA;IACpB,CAAA;IACR,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAW,sCACT,IACI,mDACA;KAEN,cAAY,EAAG,wCAAwC,sBAAsB;KAC7E,gBAAc;KACd,eAAY;eAEZ,kBAAC,GAAD,EAAS,WAAU,SAAU,CAAA;IACvB,CAAA;IAER,kBAAC,GAAD,CAA2B,CAAA;IAK3B,kBAAC,GAAD,CAAyB,CAAA;IACzB,kBAAC,GAAD,CAAsB,CAAA;IACrB,KACC,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cACE,IACI,EAAG,sCAAsC,mBAAmB,IAC5D,EAAG,qCAAqC,oBAAoB;KAElE,gBAAc;KACd,eAAY;eAEF,EAAT,IAAU,IAAqC,GAAtC,EAAa,WAAU,SAAU,CAAoC;IACzE,CAAA;IAEV,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cAAY,EAAG,sCAAsC,iBAAiB;KACtE,eAAY;eAEZ,kBAAC,GAAD,EAAG,WAAU,SAAU,CAAA;IACjB,CAAA;GACL;IACF;;AAET"}
1
+ {"version":3,"file":"AssistantHeader.js","names":[],"sources":["../../../src/components/assistant/AssistantHeader.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Sparkles, Plus, History, PanelRight, PanelBottom, X } from 'lucide-react';\nimport { AssistantMoreMenu } from './AssistantMoreMenu';\nimport { useTr } from '../../shared/hooks/useTr';\n\ninterface Props {\n /** Friendly label for the page the user is on (e.g. \"Inventory\"). */\n contextLabel: string;\n onNewConversation: () => void;\n onOpenHistory: () => void;\n /** True when the history drawer is currently open (drives the toggle state). */\n historyOpen: boolean;\n onClose: () => void;\n docked?: boolean;\n onToggleDock?: () => void;\n}\n\n/**\n * AssistantHeader — the v2 identity bar (per the ai-assistant-v2 mockups):\n * a ✦ brand mark + \"HealthyBowl AI\", a small availability/context subtitle\n * (\"Ready · Context: <page>\"), and a row of icon actions: New conversation,\n * History (opens the conversation list as an overlay drawer — NOT an accordion),\n * Export, Dock toggle, Close.\n *\n * Replaces the old \"Conversation History\" accordion header. HB semantic tokens\n * only; copy via useTr.\n */\nexport const AssistantHeader: FC<Props> = ({\n contextLabel,\n onNewConversation,\n onOpenHistory,\n historyOpen,\n onClose,\n docked,\n onToggleDock,\n}) => {\n const tr = useTr();\n\n return (\n <div className=\"flex items-center gap-2 border-b border-border-default bg-bg-elevated px-3 py-2.5\">\n {/* Brand + context subtitle */}\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n <span className=\"flex size-7 flex-shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-action-primary-bg/25 to-action-primary-bg/5 text-action-primary-bg\">\n <Sparkles className=\"size-4\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-[14px] font-semibold leading-tight text-text-primary\">\n {tr('healthybowl.assistant.header.title', 'HealthyBowl AI')}\n </span>\n <span className=\"block truncate text-[11px] leading-tight text-text-muted\">\n {tr('healthybowl.assistant.header.ready', 'Ready')}\n <span aria-hidden=\"true\"> · </span>\n {tr('healthybowl.assistant.header.context', 'Context: {{page}}', { page: contextLabel })}\n </span>\n </span>\n </div>\n\n {/* Actions */}\n <div className=\"flex flex-shrink-0 items-center gap-0.5\">\n <button\n type=\"button\"\n onClick={onNewConversation}\n className=\"rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n aria-label={tr('healthybowl.assistant.header.newConversation', 'New conversation')}\n data-testid=\"assistant-new-conversation\"\n >\n <Plus className=\"size-4\" />\n </button>\n <button\n type=\"button\"\n onClick={onOpenHistory}\n className={`rounded-lg p-1.5 transition-colors ${\n historyOpen\n ? 'bg-action-primary-bg/15 text-action-primary-bg'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n }`}\n aria-label={tr('healthybowl.assistant.header.history', 'Conversation history')}\n aria-pressed={historyOpen}\n data-testid=\"assistant-open-history\"\n >\n <History className=\"size-4\" />\n </button>\n {/* Renders nothing where the browser has no speech output. */}\n <AssistantMoreMenu />\n {onToggleDock && (\n <button\n type=\"button\"\n onClick={onToggleDock}\n className=\"hidden rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary md:inline-flex\"\n aria-label={\n docked\n ? tr('healthybowl.assistant.header.float', 'Float chat window')\n : tr('healthybowl.assistant.header.dock', 'Dock to side panel')\n }\n aria-pressed={docked}\n data-testid=\"assistant-toggle-dock\"\n >\n {docked ? <PanelBottom className=\"size-4\" /> : <PanelRight className=\"size-4\" />}\n </button>\n )}\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n aria-label={tr('healthybowl.assistant.header.close', 'Close assistant')}\n data-testid=\"assistant-close\"\n >\n <X className=\"size-4\" />\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;AA2BA,IAAa,KAA8B,EACzC,iBACA,sBACA,kBACA,gBACA,YACA,WACA,sBACI;CACJ,IAAM,IAAK,EAAM;CAEjB,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CAEE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cACd,kBAAC,GAAD,EAAU,WAAU,SAAU,CAAA;GAC1B,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;cAAhB,CACE,kBAAC,QAAD;KAAM,WAAU;eACb,EAAG,sCAAsC,gBAAgB;IACtD,CAAA,GACN,kBAAC,QAAD;KAAM,WAAU;eAAhB;MACG,EAAG,sCAAsC,OAAO;MACjD,kBAAC,QAAD;OAAM,eAAY;iBAAO;MAAS,CAAA;MACjC,EAAG,wCAAwC,qBAAqB,EAAE,MAAM,EAAa,CAAC;KACnF;MACF;KACH;MAGL,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cAAY,EAAG,gDAAgD,kBAAkB;KACjF,eAAY;eAEZ,kBAAC,GAAD,EAAM,WAAU,SAAU,CAAA;IACpB,CAAA;IACR,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAW,sCACT,IACI,mDACA;KAEN,cAAY,EAAG,wCAAwC,sBAAsB;KAC7E,gBAAc;KACd,eAAY;eAEZ,kBAAC,GAAD,EAAS,WAAU,SAAU,CAAA;IACvB,CAAA;IAER,kBAAC,GAAD,CAAoB,CAAA;IACnB,KACC,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cACE,IACI,EAAG,sCAAsC,mBAAmB,IAC5D,EAAG,qCAAqC,oBAAoB;KAElE,gBAAc;KACd,eAAY;eAEF,EAAT,IAAU,IAAqC,GAAtC,EAAa,WAAU,SAAU,CAAoC;IACzE,CAAA;IAEV,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cAAY,EAAG,sCAAsC,iBAAiB;KACtE,eAAY;eAEZ,kBAAC,GAAD,EAAG,WAAU,SAAU,CAAA;IACjB,CAAA;GACL;IACF;;AAET"}
@@ -0,0 +1,121 @@
1
+ import { useAssistantStore as e } from "../../store/assistantStore.js";
2
+ import { useTr as t } from "../../shared/hooks/useTr.js";
3
+ import { downloadFile as n, exportConversation as r } from "../../services/assistantExportService.js";
4
+ import { useAssistantSpeech as i } from "./AssistantSpeechProvider.js";
5
+ import { AssistantVoiceSelector as a } from "./composer/AssistantVoiceSelector.js";
6
+ import { useEffect as o, useRef as s, useState as c } from "react";
7
+ import { Check as l, FileJson as u, FileText as d, MoreHorizontal as f, Play as p, Volume2 as m } from "lucide-react";
8
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
9
+ //#region src/components/assistant/AssistantMoreMenu.tsx
10
+ var v = () => {
11
+ let v = t(), [y, b] = c(!1), x = s(null), S = s(null), { conversations: C, activeConversationId: w } = e(), T = C.find((e) => e.id === w), E = !!(T && T.messages.length > 0), { isSupported: D, isBlocked: O, disabledReason: k, autoSpeakEnabled: A, setAutoSpeak: j, stop: M, previewVoice: N, activeVoiceName: P } = i(), F = O && !A;
12
+ o(() => {
13
+ if (!y) return;
14
+ let e = (e) => {
15
+ e.key === "Escape" && (b(!1), S.current?.focus());
16
+ }, t = (e) => {
17
+ let t = e.target;
18
+ x.current?.contains(t) || S.current?.contains(t) || b(!1);
19
+ };
20
+ return window.addEventListener("keydown", e), document.addEventListener("mousedown", t), () => {
21
+ window.removeEventListener("keydown", e), document.removeEventListener("mousedown", t);
22
+ };
23
+ }, [y]);
24
+ let I = (e) => {
25
+ if (!T) return;
26
+ let { content: t, filename: i, mimeType: a } = r(T, e);
27
+ n(t, i, a), b(!1);
28
+ }, L = () => {
29
+ A && M(), j(!A);
30
+ }, R = v("healthybowl.assistant.header.more", "More options");
31
+ return /* @__PURE__ */ _("div", {
32
+ className: "relative",
33
+ children: [/* @__PURE__ */ g("button", {
34
+ ref: S,
35
+ type: "button",
36
+ onClick: () => b((e) => !e),
37
+ className: "rounded p-1 transition-colors hover:bg-bg-elevated",
38
+ "aria-label": R,
39
+ "aria-haspopup": "menu",
40
+ "aria-expanded": y,
41
+ "data-testid": "assistant-more",
42
+ children: /* @__PURE__ */ g(f, { className: "size-4 text-text-secondary" })
43
+ }), y ? /* @__PURE__ */ _("div", {
44
+ ref: x,
45
+ role: "menu",
46
+ "aria-label": R,
47
+ className: "absolute right-0 top-full z-50 mt-1 min-w-56 overflow-hidden rounded-xl border border-border-default bg-bg-surface py-1 shadow-lg",
48
+ "data-testid": "assistant-more-menu",
49
+ children: [
50
+ D ? /* @__PURE__ */ _("button", {
51
+ type: "button",
52
+ role: "menuitemcheckbox",
53
+ "aria-checked": A,
54
+ onClick: L,
55
+ disabled: F,
56
+ title: F ? k ?? void 0 : void 0,
57
+ className: "flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-text-primary transition-colors hover:bg-bg-elevated disabled:cursor-not-allowed disabled:text-text-muted disabled:hover:bg-transparent",
58
+ "data-testid": "assistant-auto-speak",
59
+ children: [
60
+ /* @__PURE__ */ g(m, {
61
+ className: "size-3.5 flex-shrink-0 text-text-secondary",
62
+ "aria-hidden": "true"
63
+ }),
64
+ /* @__PURE__ */ g("span", {
65
+ className: "flex-1",
66
+ children: v("healthybowl.assistant.header.autoRead", "Auto-read replies")
67
+ }),
68
+ A ? /* @__PURE__ */ g(l, { className: "size-3.5 flex-shrink-0 text-action-primary-bg" }) : null
69
+ ]
70
+ }) : null,
71
+ /* @__PURE__ */ _("div", {
72
+ className: "flex items-center gap-1 px-3 py-1.5",
73
+ "data-testid": "assistant-more-voice",
74
+ children: [/* @__PURE__ */ g(a, {}), P ? /* @__PURE__ */ _("button", {
75
+ type: "button",
76
+ onClick: () => N(P),
77
+ className: "flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-text-muted transition-colors hover:bg-bg-elevated hover:text-text-secondary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
78
+ "aria-label": v("healthybowl.assistant.voice.preview", "Hear this voice"),
79
+ "data-testid": "assistant-voice-preview",
80
+ children: [/* @__PURE__ */ g(p, {
81
+ className: "size-3",
82
+ "aria-hidden": "true"
83
+ }), v("healthybowl.assistant.voice.previewShort", "Preview")]
84
+ }) : null]
85
+ }),
86
+ E ? /* @__PURE__ */ _(h, { children: [
87
+ /* @__PURE__ */ g("div", {
88
+ className: "my-1 border-t border-border-subtle",
89
+ role: "separator"
90
+ }),
91
+ /* @__PURE__ */ _("button", {
92
+ type: "button",
93
+ role: "menuitem",
94
+ onClick: () => I("json"),
95
+ className: "flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-text-primary transition-colors hover:bg-bg-elevated",
96
+ "data-testid": "export-json",
97
+ children: [/* @__PURE__ */ g(u, {
98
+ className: "size-3.5 flex-shrink-0 text-text-secondary",
99
+ "aria-hidden": "true"
100
+ }), v("healthybowl.assistant.export.json", "Export as JSON")]
101
+ }),
102
+ /* @__PURE__ */ _("button", {
103
+ type: "button",
104
+ role: "menuitem",
105
+ onClick: () => I("markdown"),
106
+ className: "flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-text-primary transition-colors hover:bg-bg-elevated",
107
+ "data-testid": "export-markdown",
108
+ children: [/* @__PURE__ */ g(d, {
109
+ className: "size-3.5 flex-shrink-0 text-text-secondary",
110
+ "aria-hidden": "true"
111
+ }), v("healthybowl.assistant.export.markdown", "Export as Markdown")]
112
+ })
113
+ ] }) : null
114
+ ]
115
+ }) : null]
116
+ });
117
+ };
118
+ //#endregion
119
+ export { v as AssistantMoreMenu };
120
+
121
+ //# sourceMappingURL=AssistantMoreMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantMoreMenu.js","names":[],"sources":["../../../src/components/assistant/AssistantMoreMenu.tsx"],"sourcesContent":["import { useEffect, useRef, useState, type FC } from 'react';\nimport { Check, FileJson, FileText, MoreHorizontal, Play, Volume2 } from 'lucide-react';\nimport { useAssistantStore } from '@/store/assistantStore';\nimport { exportConversation, downloadFile } from '@/services/assistantExportService';\nimport { useAssistantSpeech } from './AssistantSpeechProvider';\nimport { AssistantVoiceSelector } from './composer/AssistantVoiceSelector';\nimport { useTr } from '../../shared/hooks/useTr';\n\n/**\n * The header's secondary surface — everything that CONFIGURES the assistant.\n *\n * ★ `+` supplies content, `⋯` configures. Keeping those two meanings apart is\n * the point: the header carried seven controls, and three of them\n * (auto-read, the voice picker, export) render null under conditions the user\n * cannot see — no speech support, fewer than two voices, an empty conversation —\n * so the row silently changed width between devices and between the first and\n * second message of the same session.\n *\n * Now four primary controls, always present, and one menu that absorbs the\n * conditional ones. A menu ROW may still hide itself; a menu that keeps its\n * position while its contents vary is a much smaller surprise than a toolbar\n * that reflows.\n *\n * ★ Export is FLATTENED into this menu rather than nested inside it. It was\n * itself a dropdown, and a dropdown inside a dropdown is two Escape presses and\n * two outside-click regions for two menu items.\n *\n * ★ The voice picker keeps its native `<select>`. It is deliberate — see that\n * component — and a custom listbox would look tidier in a screenshot while being\n * worse on the phones this product is used on. Because the select lives inside\n * the menu's own subtree, the outside-click handler ignores clicks on it.\n *\n * Not included, deliberately: Live captions and Assistant settings have nothing\n * behind them yet, and a Transcript entry needs a product decision first (the\n * voice transcript is session-scoped, while the chat thread is always visible —\n * one menu label cannot honestly mean both).\n */\nexport const AssistantMoreMenu: FC = () => {\n const tr = useTr();\n const [open, setOpen] = useState(false);\n const menuRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const { conversations, activeConversationId } = useAssistantStore();\n const activeConversation = conversations.find((conversation) => conversation.id === activeConversationId);\n const canExport = Boolean(activeConversation && activeConversation.messages.length > 0);\n\n const {\n isSupported,\n isBlocked,\n disabledReason,\n autoSpeakEnabled,\n setAutoSpeak,\n stop,\n previewVoice,\n activeVoiceName,\n } = useAssistantSpeech();\n // Blocked and already off means turning it on would do nothing audible.\n const autoReadDisabled = isBlocked && !autoSpeakEnabled;\n\n useEffect(() => {\n if (!open) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpen(false);\n buttonRef.current?.focus();\n }\n };\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (menuRef.current?.contains(target) || buttonRef.current?.contains(target)) return;\n setOpen(false);\n };\n window.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onPointerDown);\n return () => {\n window.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onPointerDown);\n };\n }, [open]);\n\n const handleExport = (format: 'json' | 'markdown') => {\n if (!activeConversation) return;\n const { content, filename, mimeType } = exportConversation(activeConversation, format);\n downloadFile(content, filename, mimeType);\n setOpen(false);\n };\n\n const toggleAutoRead = () => {\n // Turning it OFF stops whatever is speaking now: leaving audio running\n // after the user switched the feature off reads as the control not working.\n if (autoSpeakEnabled) stop();\n setAutoSpeak(!autoSpeakEnabled);\n };\n\n const label = tr('healthybowl.assistant.header.more', 'More options');\n\n return (\n <div className=\"relative\">\n <button\n ref={buttonRef}\n type=\"button\"\n onClick={() => setOpen((wasOpen) => !wasOpen)}\n className=\"rounded p-1 transition-colors hover:bg-bg-elevated\"\n aria-label={label}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n data-testid=\"assistant-more\"\n >\n <MoreHorizontal className=\"size-4 text-text-secondary\" />\n </button>\n\n {open ? (\n <div\n ref={menuRef}\n role=\"menu\"\n aria-label={label}\n className=\"absolute right-0 top-full z-50 mt-1 min-w-56 overflow-hidden rounded-xl border border-border-default bg-bg-surface py-1 shadow-lg\"\n data-testid=\"assistant-more-menu\"\n >\n {isSupported ? (\n <button\n type=\"button\"\n role=\"menuitemcheckbox\"\n aria-checked={autoSpeakEnabled}\n onClick={toggleAutoRead}\n disabled={autoReadDisabled}\n title={autoReadDisabled ? (disabledReason ?? undefined) : undefined}\n className=\"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-text-primary transition-colors hover:bg-bg-elevated disabled:cursor-not-allowed disabled:text-text-muted disabled:hover:bg-transparent\"\n data-testid=\"assistant-auto-speak\"\n >\n <Volume2 className=\"size-3.5 flex-shrink-0 text-text-secondary\" aria-hidden=\"true\" />\n <span className=\"flex-1\">{tr('healthybowl.assistant.header.autoRead', 'Auto-read replies')}</span>\n {/* State as a tick rather than the word \"On\": the row is already a\n checkbox to assistive technology via aria-checked. */}\n {autoSpeakEnabled ? <Check className=\"size-3.5 flex-shrink-0 text-action-primary-bg\" /> : null}\n </button>\n ) : null}\n\n {/* Renders nothing when the device offers fewer than two voices, which\n is most of them until a hosted TTS endpoint is configured. */}\n <div className=\"flex items-center gap-1 px-3 py-1.5\" data-testid=\"assistant-more-voice\">\n <AssistantVoiceSelector />\n {/* ★ Auditioning a voice used to cost a round trip: you picked one,\n nothing happened, and you first heard it after asking a real\n question. This speaks a short sample straight through the engine —\n no model call, no message in the thread, no tokens. Shown only\n once a voice has resolved, so it can never be a dead control. */}\n {activeVoiceName ? (\n <button\n type=\"button\"\n onClick={() => previewVoice(activeVoiceName)}\n className=\"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-text-muted transition-colors hover:bg-bg-elevated hover:text-text-secondary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong\"\n aria-label={tr('healthybowl.assistant.voice.preview', 'Hear this voice')}\n data-testid=\"assistant-voice-preview\"\n >\n <Play className=\"size-3\" aria-hidden=\"true\" />\n {tr('healthybowl.assistant.voice.previewShort', 'Preview')}\n </button>\n ) : null}\n </div>\n\n {canExport ? (\n <>\n <div className=\"my-1 border-t border-border-subtle\" role=\"separator\" />\n <button\n type=\"button\"\n role=\"menuitem\"\n onClick={() => handleExport('json')}\n className=\"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-text-primary transition-colors hover:bg-bg-elevated\"\n data-testid=\"export-json\"\n >\n <FileJson className=\"size-3.5 flex-shrink-0 text-text-secondary\" aria-hidden=\"true\" />\n {tr('healthybowl.assistant.export.json', 'Export as JSON')}\n </button>\n <button\n type=\"button\"\n role=\"menuitem\"\n onClick={() => handleExport('markdown')}\n className=\"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-text-primary transition-colors hover:bg-bg-elevated\"\n data-testid=\"export-markdown\"\n >\n <FileText className=\"size-3.5 flex-shrink-0 text-text-secondary\" aria-hidden=\"true\" />\n {tr('healthybowl.assistant.export.markdown', 'Export as Markdown')}\n </button>\n </>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n};\n"],"mappings":"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"}