@broberg/bodymap 0.6.0 → 0.7.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/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);
@@ -711,7 +715,18 @@ function BodyMap3D(props) {
711
715
  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
716
  region.code,
713
717
  region.side ? " \xB7 " + region.side : ""
714
- ] })
718
+ ] }),
719
+ /* @__PURE__ */ jsx(
720
+ "button",
721
+ {
722
+ type: "button",
723
+ "data-testid": "bodymap3d-close",
724
+ "aria-label": L.close,
725
+ onClick: () => setSelected(null),
726
+ style: { ...btn, width: 32, height: 32, padding: 0, fontSize: 20, lineHeight: 1, color: chrome.mutedText, borderColor: chrome.border, background: chrome.panelBg },
727
+ children: "\xD7"
728
+ }
729
+ )
715
730
  ] }),
716
731
  /* @__PURE__ */ jsx("div", { style: { fontSize: 11, fontWeight: 700, letterSpacing: ".06em", textTransform: "uppercase", color: chrome.mutedText, marginBottom: 7 }, children: L.intensity }),
717
732
  /* @__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)) }),