@broberg/bodymap 0.14.0 → 0.16.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 +24 -0
- package/dist/preact.cjs +784 -0
- package/dist/preact.cjs.map +1 -0
- package/dist/preact.d.cts +228 -0
- package/dist/preact.d.ts +228 -0
- package/dist/preact.js +779 -0
- package/dist/preact.js.map +1 -0
- package/dist/react.cjs +4 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +5 -0
- package/dist/react.d.ts +5 -0
- package/dist/react.js +4 -0
- package/dist/react.js.map +1 -1
- package/dist/three.cjs +3 -0
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +5 -0
- package/dist/three.d.ts +5 -0
- package/dist/three.js +3 -0
- package/dist/three.js.map +1 -1
- package/package.json +14 -4
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
|
|
@@ -239,6 +254,15 @@ region *in order to mark it*. Nobody had ever tested changing their mind. Nothin
|
|
|
239
254
|
was behaving wrongly — it was a path with no exit, and paths with no exit do not
|
|
240
255
|
fail, they strand people.
|
|
241
256
|
|
|
257
|
+
### The open panel asks for what it wants (0.16.0)
|
|
258
|
+
|
|
259
|
+
With a region open and nothing marked, both renderers show a question —
|
|
260
|
+
«Hvor ondt gør det? Vælg et tal.» / «How much does it hurt? Pick a number.»
|
|
261
|
+
(`bodymap-ask` / `bodymap3d-ask`). It disappears once an intensity is chosen.
|
|
262
|
+
Without it, the missing «Remove» read as *the button is gone* rather than
|
|
263
|
+
*nothing chosen yet* — the product's own owner reported it as a bug. Change the
|
|
264
|
+
text with `labels={{ ask: "…" }}`; `ask: ""` hides it.
|
|
265
|
+
|
|
242
266
|
## Fullscreen — fill the viewport with the body
|
|
243
267
|
|
|
244
268
|
```tsx
|