@eka-care/medassist-widget 0.1.97-dev.0 → 0.1.98-0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eka-care/medassist-widget",
3
3
  "description": "MedAssist Widget react application",
4
- "version": "0.1.97-dev.0",
4
+ "version": "0.1.98-0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -1,85 +0,0 @@
1
- import { c as m, A as u, u as e, s as h, p as f, S as p, B as g } from "./medassist-widget.js";
2
- const x = [
3
- [
4
- "path",
5
- {
6
- d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
7
- key: "18u6gg"
8
- }
9
- ],
10
- ["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
11
- ], w = m("camera", x);
12
- const b = [
13
- ["path", { d: "M12 15V3", key: "m9g1x1" }],
14
- ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
15
- ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
16
- ], y = m("download", b);
17
- function i(a) {
18
- return a.toLowerCase().endsWith(".pdf");
19
- }
20
- function v(a) {
21
- const n = document?.createElement("a");
22
- n.href = a, n.download = a.split("/").pop() ?? "download.pdf", n.target = "_blank", document?.body?.appendChild(n), n.click(), document?.body?.removeChild(n);
23
- }
24
- async function N(a) {
25
- if (!a.current) return;
26
- const n = (await import("./medassist-widget-html2canvas.esm-CphxV6YW.js")).default, o = await n(a.current, { useCORS: !0 }), t = document.createElement("a");
27
- t.href = o.toDataURL("image/png"), t.download = "card.png", t.click();
28
- }
29
- async function k(a) {
30
- if (!a.current) return;
31
- const n = (await import("./medassist-widget-html2canvas.esm-CphxV6YW.js")).default, o = await n(a.current, { useCORS: !0 }), t = document.createElement("a");
32
- t.href = o.toDataURL("image/png"), t.download = `screenshot-${Date.now()}.png`, t.click();
33
- }
34
- function _({ card: a }) {
35
- const { title: n, description: o, tags_text: t, banner_text: l, action: r, link: c } = a, s = u(null), d = c && !i(c);
36
- return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: [
37
- /* @__PURE__ */ e(
38
- h,
39
- {
40
- ref: s,
41
- className: "overflow-hidden rounded-xl border border-border bg-elicitationBg text-card-foreground shadow-sm",
42
- children: /* @__PURE__ */ e(f, { className: "p-3 space-y-2", children: [
43
- /* @__PURE__ */ e("div", { className: `flex items-start gap-3 ${d ? "justify-between" : "justify-center"}`, children: [
44
- /* @__PURE__ */ e("div", { className: `space-y-2 ${d ? "min-w-0 flex-1" : "flex flex-col items-center"}`, children: [
45
- n && /* @__PURE__ */ e("span", { className: "inline-block rounded-full px-3 py-1 text-sm font-semibold bg-primary text-primary-foreground", children: n }),
46
- o && /* @__PURE__ */ e("p", { className: `text-sm text-foreground leading-snug ${d ? "" : "text-center"}`, children: o }),
47
- l && /* @__PURE__ */ e("span", { className: "inline-block rounded-full px-3 py-1 text-xs font-semibold bg-green-600 text-white", children: l })
48
- ] }),
49
- d && /* @__PURE__ */ e("div", { className: "shrink-0 h-24 w-24 rounded-lg overflow-hidden border border-border", children: /* @__PURE__ */ e(
50
- "img",
51
- {
52
- src: c,
53
- alt: n ?? "media",
54
- className: "h-full w-full object-cover"
55
- }
56
- ) })
57
- ] }),
58
- t && /* @__PURE__ */ e(p, { children: [
59
- /* @__PURE__ */ e("div", { className: "border-t border-border" }),
60
- /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: t })
61
- ] })
62
- ] })
63
- }
64
- ),
65
- r && /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ e(
66
- g,
67
- {
68
- type: "button",
69
- variant: "outline",
70
- size: "sm",
71
- className: "rounded-md px-5 gap-1.5",
72
- onClick: () => {
73
- r === "screenshot" ? k(s) : r === "download" && (c && i(c) ? v(c) : N(s));
74
- },
75
- children: [
76
- r === "screenshot" ? /* @__PURE__ */ e(w, { className: "h-4 w-4" }) : /* @__PURE__ */ e(y, { className: "h-4 w-4" }),
77
- r === "screenshot" ? "Screenshot" : "Download"
78
- ]
79
- }
80
- ) })
81
- ] });
82
- }
83
- export {
84
- _ as MediaCard
85
- };