@burdenoff/microfe-healthybowl 2026.902.12 → 2026.902.14
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/dist/components/assistant/composer/AssistantAttachmentButton.js +80 -29
- package/dist/components/assistant/composer/AssistantAttachmentButton.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlData.js +0 -15
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/offline/graphql.js.map +1 -1
- package/dist/healthybowl/offline/syncEngine.js +1 -2
- package/dist/healthybowl/offline/syncEngine.js.map +1 -1
- package/dist/healthybowl/offline/types.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +188 -228
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js +191 -261
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +419 -520
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/utils/attachmentSources.js +43 -0
- package/dist/utils/attachmentSources.js.map +1 -0
- package/package.json +1 -1
- package/dist/healthybowl/hooks/useConsultationPayments.js +0 -59
- package/dist/healthybowl/hooks/useConsultationPayments.js.map +0 -1
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js +0 -49
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js.map +0 -1
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js +0 -48
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js.map +0 -1
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js +0 -54
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js.map +0 -1
|
@@ -1,35 +1,86 @@
|
|
|
1
1
|
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import "../../../utils/assistantAttachments.js";
|
|
3
|
+
import { availableAttachmentSources as t, deviceHasCamera as n } from "../../../utils/attachmentSources.js";
|
|
4
|
+
import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
5
|
+
import { Camera as c, FileText as l, FolderOpen as u, ImageIcon as d, Plus as f } from "lucide-react";
|
|
6
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/assistant/composer/AssistantAttachmentButton.tsx
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
8
|
+
var h = {
|
|
9
|
+
camera: c,
|
|
10
|
+
gallery: d,
|
|
11
|
+
documents: l,
|
|
12
|
+
files: u
|
|
13
|
+
}, g = ({ onFiles: c, canAddMore: l, disabled: u = !1 }) => {
|
|
14
|
+
let d = e(), g = o(null), _ = o(null), v = o(null), [y, b] = s(!1), x = a(() => t(n()), []), S = l ? d("healthybowl.assistant.composer.attach", "Attach files or photos") : d("healthybowl.assistant.composer.attachFull", "Attachment limit reached ({{max}})", { max: 5 });
|
|
15
|
+
i(() => {
|
|
16
|
+
if (!y) return;
|
|
17
|
+
let e = (e) => {
|
|
18
|
+
e.key === "Escape" && (b(!1), v.current?.focus());
|
|
19
|
+
}, t = (e) => {
|
|
20
|
+
let t = e.target;
|
|
21
|
+
_.current?.contains(t) || v.current?.contains(t) || b(!1);
|
|
22
|
+
};
|
|
23
|
+
return window.addEventListener("keydown", e), window.addEventListener("mousedown", t), () => {
|
|
24
|
+
window.removeEventListener("keydown", e), window.removeEventListener("mousedown", t);
|
|
25
|
+
};
|
|
26
|
+
}, [y]);
|
|
27
|
+
let C = r((e) => {
|
|
28
|
+
c(e.target.files), e.target.value = "";
|
|
29
|
+
}, [c]), w = r((e) => {
|
|
30
|
+
let t = g.current;
|
|
31
|
+
t && (t.accept = e.accept, t.multiple = e.multiple, e.capture ? t.setAttribute("capture", e.capture) : t.removeAttribute("capture"), b(!1), t.click());
|
|
32
|
+
}, []);
|
|
33
|
+
return /* @__PURE__ */ m("div", {
|
|
34
|
+
className: "relative flex-shrink-0",
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ p("input", {
|
|
37
|
+
ref: g,
|
|
38
|
+
type: "file",
|
|
39
|
+
multiple: !0,
|
|
40
|
+
className: "hidden",
|
|
41
|
+
onChange: C,
|
|
42
|
+
tabIndex: -1,
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
"data-testid": "assistant-attach-input"
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ p("button", {
|
|
47
|
+
ref: v,
|
|
48
|
+
type: "button",
|
|
49
|
+
onClick: () => b((e) => !e),
|
|
50
|
+
disabled: u || !l,
|
|
51
|
+
title: S,
|
|
52
|
+
"aria-label": S,
|
|
53
|
+
"aria-haspopup": "menu",
|
|
54
|
+
"aria-expanded": y,
|
|
55
|
+
className: "flex size-9 items-center justify-center rounded-full border border-border-subtle bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:text-text-muted disabled:hover:bg-bg-elevated",
|
|
56
|
+
"data-testid": "assistant-attach",
|
|
57
|
+
children: /* @__PURE__ */ p(f, { className: "size-4" })
|
|
58
|
+
}),
|
|
59
|
+
y ? /* @__PURE__ */ p("div", {
|
|
60
|
+
ref: _,
|
|
61
|
+
role: "menu",
|
|
62
|
+
"aria-label": d("healthybowl.assistant.composer.attachSource", "Attach from"),
|
|
63
|
+
className: "absolute bottom-full left-0 z-30 mb-2 min-w-44 overflow-hidden rounded-xl border border-border-default bg-bg-elevated py-1 shadow-lg",
|
|
64
|
+
"data-testid": "assistant-attach-menu",
|
|
65
|
+
children: x.map((e) => {
|
|
66
|
+
let t = h[e.id];
|
|
67
|
+
return /* @__PURE__ */ m("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
role: "menuitem",
|
|
70
|
+
onClick: () => w(e),
|
|
71
|
+
className: "flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:bg-bg-sunken",
|
|
72
|
+
"data-testid": `assistant-attach-source-${e.id}`,
|
|
73
|
+
children: [/* @__PURE__ */ p(t, {
|
|
74
|
+
className: "size-4 flex-shrink-0 text-text-secondary",
|
|
75
|
+
"aria-hidden": "true"
|
|
76
|
+
}), d(e.labelKey, e.labelFallback)]
|
|
77
|
+
}, e.id);
|
|
78
|
+
})
|
|
79
|
+
}) : null
|
|
80
|
+
]
|
|
81
|
+
});
|
|
31
82
|
};
|
|
32
83
|
//#endregion
|
|
33
|
-
export {
|
|
84
|
+
export { g as AssistantAttachmentButton };
|
|
34
85
|
|
|
35
86
|
//# sourceMappingURL=AssistantAttachmentButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantAttachmentButton.js","names":[],"sources":["../../../../src/components/assistant/composer/AssistantAttachmentButton.tsx"],"sourcesContent":["import { useCallback, useRef, type ChangeEvent, type FC } from 'react';\nimport { Plus } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport {
|
|
1
|
+
{"version":3,"file":"AssistantAttachmentButton.js","names":[],"sources":["../../../../src/components/assistant/composer/AssistantAttachmentButton.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState, type ChangeEvent, type FC } from 'react';\nimport { Camera, FileText, FolderOpen, ImageIcon, Plus } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { MAX_ATTACHMENTS } from '@/utils/assistantAttachments';\nimport {\n availableAttachmentSources,\n deviceHasCamera,\n type AttachmentSource,\n type AttachmentSourceId,\n} from '@/utils/attachmentSources';\n\ninterface Props {\n onFiles: (files: FileList | null) => void;\n /** False once MAX_ATTACHMENTS is reached — the control explains why. */\n canAddMore: boolean;\n disabled?: boolean;\n}\n\nconst SOURCE_ICONS: Record<AttachmentSourceId, typeof Camera> = {\n camera: Camera,\n gallery: ImageIcon,\n documents: FileText,\n files: FolderOpen,\n};\n\n/**\n * Leading circular \"+\" attach control in the composer.\n *\n * ★ Opens a SOURCE MENU rather than the OS picker directly. One picker had to\n * stand in for every source, and on a phone it lands in Files — so\n * photographing a diseased leaf, the single most likely thing a farmer wants to\n * show the assistant, meant leaving for the camera app and coming back.\n *\n * ★ One input, reconfigured per source, rather than one input each. `accept` and\n * `capture` are set immediately before `.click()`, so there is exactly one place\n * a change event can arrive from and the existing `onFiles` contract — shared\n * with drag-drop and paste — is untouched.\n *\n * ★ Camera uses the `capture` attribute rather than a bespoke `getUserMedia`\n * viewfinder. That hands capture → preview → retake → use to the OS camera,\n * which does it better, is already localised, and cannot be exercised on a\n * desktop CI box at all; on a device without a camera the attribute is ignored\n * and the picker opens as usual, so it degrades instead of breaking.\n *\n * `accept` is advisory — the picker still allows \"All files\" on most platforms —\n * so validation lives in `validateFile`, not here.\n */\nexport const AssistantAttachmentButton: FC<Props> = ({ onFiles, canAddMore, disabled = false }) => {\n const tr = useTr();\n const inputRef = useRef<HTMLInputElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(false);\n\n // Read once per mount: a device does not sprout a camera mid-session, and\n // matchMedia in render would run on every keystroke in the composer.\n const sources = useMemo(() => availableAttachmentSources(deviceHasCamera()), []);\n\n const label = canAddMore\n ? tr('healthybowl.assistant.composer.attach', 'Attach files or photos')\n : tr('healthybowl.assistant.composer.attachFull', 'Attachment limit reached ({{max}})', {\n max: MAX_ATTACHMENTS,\n });\n\n // Escape closes, and a click anywhere else closes — the same contract as the\n // export menu, so the two dropdowns in this panel behave identically.\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 window.addEventListener('mousedown', onPointerDown);\n return () => {\n window.removeEventListener('keydown', onKeyDown);\n window.removeEventListener('mousedown', onPointerDown);\n };\n }, [open]);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n onFiles(event.target.files);\n // Reset so picking the SAME file twice in a row still fires a change event.\n event.target.value = '';\n },\n [onFiles]\n );\n\n const pick = useCallback((source: AttachmentSource) => {\n const input = inputRef.current;\n if (!input) return;\n input.accept = source.accept;\n input.multiple = source.multiple;\n // A property, not an attribute: `capture=\"\"` still means \"use the camera\",\n // so it has to be removed rather than blanked when the source is not camera.\n if (source.capture) input.setAttribute('capture', source.capture);\n else input.removeAttribute('capture');\n setOpen(false);\n input.click();\n }, []);\n\n return (\n <div className=\"relative flex-shrink-0\">\n <input\n ref={inputRef}\n type=\"file\"\n multiple\n className=\"hidden\"\n onChange={handleChange}\n tabIndex={-1}\n aria-hidden=\"true\"\n data-testid=\"assistant-attach-input\"\n />\n <button\n ref={buttonRef}\n type=\"button\"\n onClick={() => setOpen((wasOpen) => !wasOpen)}\n disabled={disabled || !canAddMore}\n title={label}\n aria-label={label}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n className=\"flex size-9 items-center justify-center rounded-full border border-border-subtle bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:text-text-muted disabled:hover:bg-bg-elevated\"\n data-testid=\"assistant-attach\"\n >\n <Plus className=\"size-4\" />\n </button>\n\n {open ? (\n <div\n ref={menuRef}\n role=\"menu\"\n aria-label={tr('healthybowl.assistant.composer.attachSource', 'Attach from')}\n // Opens UPWARD: the composer sits at the bottom of the panel, so a\n // downward menu would be clipped by the panel edge on every size.\n className=\"absolute bottom-full left-0 z-30 mb-2 min-w-44 overflow-hidden rounded-xl border border-border-default bg-bg-elevated py-1 shadow-lg\"\n data-testid=\"assistant-attach-menu\"\n >\n {sources.map((source) => {\n const Icon = SOURCE_ICONS[source.id];\n return (\n <button\n key={source.id}\n type=\"button\"\n role=\"menuitem\"\n onClick={() => pick(source)}\n className=\"flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:bg-bg-sunken\"\n data-testid={`assistant-attach-source-${source.id}`}\n >\n <Icon className=\"size-4 flex-shrink-0 text-text-secondary\" aria-hidden=\"true\" />\n {tr(source.labelKey, source.labelFallback)}\n </button>\n );\n })}\n </div>\n ) : null}\n </div>\n );\n};\n"],"mappings":";;;;;;;AAkBA,IAAM,IAA0D;CAC9D,QAAQ;CACR,SAAS;CACT,WAAW;CACX,OAAO;AACT,GAwBa,KAAwC,EAAE,YAAS,eAAY,cAAW,SAAY;CACjG,IAAM,IAAK,EAAM,GACX,IAAW,EAAyB,IAAI,GACxC,IAAU,EAAuB,IAAI,GACrC,IAAY,EAA0B,IAAI,GAC1C,CAAC,GAAM,KAAW,EAAS,EAAK,GAIhC,IAAU,QAAc,EAA2B,EAAgB,CAAC,GAAG,CAAC,CAAC,GAEzE,IAAQ,IACV,EAAG,yCAAyC,wBAAwB,IACpE,EAAG,6CAA6C,sCAAsC,EACpF,KAAA,EACF,CAAC;CAIL,QAAgB;EACd,IAAI,CAAC,GAAM;EACX,IAAM,KAAa,MAAyB;GAC1C,AAAI,EAAM,QAAQ,aAChB,EAAQ,EAAK,GACb,EAAU,SAA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O;KACjC,OACE,kBAAC,UAAD;MAEE,MAAK;MACL,MAAK;MACL,eAAe,EAAK,CAAM;MAC1B,WAAU;MACV,eAAa,2BAA2B,EAAO;gBANjD,CAQE,kBAAC,GAAD;OAAM,WAAU;OAA2C,eAAY;MAAQ,CAAA,GAC9E,EAAG,EAAO,UAAU,EAAO,aAAa,CACnC;QATD,EAAO,EASN;IAEZ,CAAC;GACE,CAAA,IACH;EACD;;AAET"}
|
|
@@ -289,11 +289,6 @@ var Dt = a`
|
|
|
289
289
|
notes
|
|
290
290
|
fee
|
|
291
291
|
status
|
|
292
|
-
paymentStatus
|
|
293
|
-
paymentProvider
|
|
294
|
-
paymentReference
|
|
295
|
-
paidAmount
|
|
296
|
-
paidAt
|
|
297
292
|
createdAt
|
|
298
293
|
}
|
|
299
294
|
}
|
|
@@ -310,11 +305,6 @@ var Dt = a`
|
|
|
310
305
|
notes
|
|
311
306
|
fee
|
|
312
307
|
status
|
|
313
|
-
paymentStatus
|
|
314
|
-
paymentProvider
|
|
315
|
-
paymentReference
|
|
316
|
-
paidAmount
|
|
317
|
-
paidAt
|
|
318
308
|
createdAt
|
|
319
309
|
}
|
|
320
310
|
}
|
|
@@ -331,11 +321,6 @@ var Dt = a`
|
|
|
331
321
|
notes
|
|
332
322
|
fee
|
|
333
323
|
status
|
|
334
|
-
paymentStatus
|
|
335
|
-
paymentProvider
|
|
336
|
-
paymentReference
|
|
337
|
-
paidAmount
|
|
338
|
-
paidAt
|
|
339
324
|
createdAt
|
|
340
325
|
}
|
|
341
326
|
}
|