@broberg/bodymap 0.13.3 → 0.15.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/README.md CHANGED
@@ -78,6 +78,21 @@ type RegionConfig = Record<string, { visible?: boolean; selectable?: boolean }>;
78
78
  An absent key is visible + selectable. Hidden ⇒ never selectable. `resolveRegions`
79
79
  and `isSelectable` apply the config for custom renderers.
80
80
 
81
+ ## 2D renderer (Preact) — 0.15.0, F052.4
82
+
83
+ For a Stack B app (Vite + Preact): the same `<BodyMap>` and `<BodyMapCompare>`, the same props,
84
+ `RegionConfig`, `onChange(PainReport)` and `data-testid`s — without React.
85
+
86
+ ```tsx
87
+ import { BodyMap } from "@broberg/bodymap/preact";
88
+ <BodyMap onChange={(report) => save(report)} />
89
+ ```
90
+
91
+ It is not a second implementation: `./preact` is the SAME source as `./react`, built with
92
+ `react → preact/hooks` and the Preact JSX runtime, so the two cannot drift. The build fails if
93
+ `dist/preact.*` imports `react` (check-preact.mjs). Needs `preact` (≥10.19) as a peer. The 3D
94
+ renderer stays React-only for now.
95
+
81
96
  ## 3D renderer (React + three.js)
82
97
 
83
98
  A rotatable 3D body on the **same** core + wire — a realistic Blender Studio human
@@ -274,6 +289,14 @@ this component's primary surface. A `position: fixed; inset: 0` overlay behaves
274
289
  identically on every platform, needs no user-gesture dance, and cannot leave you
275
290
  with a control that silently does nothing on the one device that matters most.
276
291
 
292
+ **On a narrow screen the panel goes UNDER the body (0.14.0).** Side by side needs
293
+ `FS_ROW_MIN` (838px) of content width. Below that, fullscreen stacks: the body
294
+ shrinks to what the panel leaves (never under 160px) and the panel sits on screen
295
+ beneath it. Before 0.14.0 the panel wrapped below a full-height canvas — on an
296
+ iPhone every intensity button sat under the bottom edge, so a patient could mark
297
+ a body part and not say how much it hurt. Wider than 838px, nothing changed.
298
+ `stackInFullscreen(width)` is exported if you need the same decision.
299
+
277
300
  ### It ships with a `ResizeObserver`, and that is not incidental
278
301
 
279
302
  Before 0.6.0 the canvas measured the element **once at mount** and only re-measured