@broberg/bodymap 0.14.0 → 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 +15 -0
- package/dist/preact.cjs +780 -0
- package/dist/preact.cjs.map +1 -0
- package/dist/preact.d.cts +223 -0
- package/dist/preact.d.ts +223 -0
- package/dist/preact.js +775 -0
- package/dist/preact.js.map +1 -0
- 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
|