@broberg/bodymap 0.6.0 → 0.7.1

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/three.d.cts CHANGED
@@ -134,6 +134,8 @@ interface BodyMapLabels {
134
134
  intensity: string;
135
135
  quality: string;
136
136
  remove: string;
137
+ /** Close the picker without marking anything (F052.26). */
138
+ close: string;
137
139
  front: string;
138
140
  back: string;
139
141
  empty: string;
package/dist/three.d.ts CHANGED
@@ -134,6 +134,8 @@ interface BodyMapLabels {
134
134
  intensity: string;
135
135
  quality: string;
136
136
  remove: string;
137
+ /** Close the picker without marking anything (F052.26). */
138
+ close: string;
137
139
  front: string;
138
140
  back: string;
139
141
  empty: string;
package/dist/three.js CHANGED
@@ -161,6 +161,7 @@ var LABELS_DA = {
161
161
  intensity: "Intensitet (0-10)",
162
162
  quality: "Kvalitet",
163
163
  remove: "Fjern punkt",
164
+ close: "Luk",
164
165
  front: "Forfra",
165
166
  back: "Bagfra",
166
167
  empty: "V\xE6lg en kropsdel for at markere smerte.",
@@ -183,6 +184,7 @@ var LABELS_EN = {
183
184
  intensity: "Intensity (0-10)",
184
185
  quality: "Quality",
185
186
  remove: "Remove point",
187
+ close: "Close",
186
188
  front: "Front",
187
189
  back: "Back",
188
190
  empty: "Pick a body part to mark pain.",
@@ -601,9 +603,11 @@ function BodyMap3D(props) {
601
603
  };
602
604
  }, []);
603
605
  useEffect(() => {
604
- if (!isFullscreen) return;
606
+ if (!isFullscreen && !selected) return;
605
607
  const onKey = (e) => {
606
- if (e.key === "Escape") setFullscreen(false);
608
+ if (e.key !== "Escape") return;
609
+ if (selected) setSelected(null);
610
+ else setFullscreen(false);
607
611
  };
608
612
  window.addEventListener("keydown", onKey);
609
613
  return () => window.removeEventListener("keydown", onKey);
@@ -659,7 +663,17 @@ function BodyMap3D(props) {
659
663
  inset: 0,
660
664
  zIndex: 2147483e3,
661
665
  background: chrome.panelBg,
662
- padding: 12,
666
+ // F052.27 — a fixed inset:0 surface in a standalone/Capacitor
667
+ // webview covers the STATUS BAR too, so a control laid out at the
668
+ // top lands on the clock and the battery. Measured by fd-sundhed
669
+ // on a real iPhone: the owner could not read the button or get
670
+ // out, and Escape does not exist on a phone. Every side gets its
671
+ // safe-area inset, bottom included — the home indicator covers
672
+ // content just as effectively.
673
+ paddingTop: "calc(12px + env(safe-area-inset-top))",
674
+ paddingBottom: "calc(12px + env(safe-area-inset-bottom))",
675
+ paddingLeft: "calc(12px + env(safe-area-inset-left))",
676
+ paddingRight: "calc(12px + env(safe-area-inset-right))",
663
677
  display: "flex",
664
678
  flexDirection: "column",
665
679
  overflow: "auto"
@@ -680,8 +694,14 @@ function BodyMap3D(props) {
680
694
  "aria-pressed": isFullscreen,
681
695
  "aria-label": isFullscreen ? UI.collapse ?? "Close" : UI.expand ?? "Expand",
682
696
  onClick: () => setFullscreen(!isFullscreen),
683
- style: { ...btn, color: chrome.text, borderColor: chrome.border, background: chrome.panelBg },
684
- children: isFullscreen ? UI.collapse ?? "Close" : UI.expand ?? "Expand"
697
+ style: {
698
+ ...btn,
699
+ color: chrome.text,
700
+ borderColor: chrome.border,
701
+ background: chrome.panelBg,
702
+ ...isFullscreen ? { width: 40, height: 40, padding: 0, fontSize: 22, lineHeight: 1 } : null
703
+ },
704
+ children: isFullscreen ? "\xD7" : UI.expand ?? "Expand"
685
705
  }
686
706
  ) }),
687
707
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 18, alignItems: "flex-start", flexWrap: "wrap", ...isFullscreen ? { flex: "1 1 auto", minHeight: 0 } : null }, children: [
@@ -711,7 +731,18 @@ function BodyMap3D(props) {
711
731
  showRegionCode && /* @__PURE__ */ jsxs("span", { "data-testid": "bodymap3d-region-code", style: { font: "11px ui-monospace, monospace", color: chrome.mutedText, background: chrome.badgeBg, borderRadius: 6, padding: "2px 7px" }, children: [
712
732
  region.code,
713
733
  region.side ? " \xB7 " + region.side : ""
714
- ] })
734
+ ] }),
735
+ /* @__PURE__ */ jsx(
736
+ "button",
737
+ {
738
+ type: "button",
739
+ "data-testid": "bodymap3d-close",
740
+ "aria-label": L.close,
741
+ onClick: () => setSelected(null),
742
+ style: { ...btn, width: 32, height: 32, padding: 0, fontSize: 20, lineHeight: 1, color: chrome.mutedText, borderColor: chrome.border, background: chrome.panelBg },
743
+ children: "\xD7"
744
+ }
745
+ )
715
746
  ] }),
716
747
  /* @__PURE__ */ jsx("div", { style: { fontSize: 11, fontWeight: 700, letterSpacing: ".06em", textTransform: "uppercase", color: chrome.mutedText, marginBottom: 7 }, children: L.intensity }),
717
748
  /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginBottom: 12 }, children: Array.from({ length: 11 }, (_, i) => /* @__PURE__ */ jsx("button", { "data-testid": `bodymap3d-intensity-${i}`, onClick: () => setPain(region.key, i, current?.type), style: { ...btn, display: "inline-flex", alignItems: "center", justifyContent: "center", minWidth: 30, height: 30, padding: 0, background: current?.intensity === i ? "#0e8f8a" : "#fff", color: current?.intensity === i ? "#fff" : "#1e293b" }, children: i }, i)) }),