@broberg/bodymap 0.12.0 → 0.13.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/index.d.cts +35 -59
- package/dist/index.d.ts +35 -59
- package/dist/react.d.cts +8 -13
- package/dist/react.d.ts +8 -13
- package/dist/three.d.cts +8 -13
- package/dist/three.d.ts +8 -13
- package/package.json +5 -4
package/dist/index.d.cts
CHANGED
|
@@ -27,38 +27,28 @@ type PainType = (typeof PAIN_TYPES)[number];
|
|
|
27
27
|
/** One marked pain point. `region` MUST be a known region key; `intensity` is a
|
|
28
28
|
* 0-10 integer; `type` is optional but constrained; `timestamp` is an ISO string. */
|
|
29
29
|
declare const painPointSchema: z.ZodObject<{
|
|
30
|
-
region: z.
|
|
30
|
+
region: z.ZodString;
|
|
31
31
|
intensity: z.ZodNumber;
|
|
32
|
-
type: z.ZodOptional<z.ZodEnum<
|
|
32
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
stikkende: "stikkende";
|
|
34
|
+
dump: "dump";
|
|
35
|
+
konstant: "konstant";
|
|
36
|
+
jagende: "jagende";
|
|
37
|
+
}>>;
|
|
33
38
|
timestamp: z.ZodString;
|
|
34
|
-
},
|
|
35
|
-
region: string;
|
|
36
|
-
intensity: number;
|
|
37
|
-
timestamp: string;
|
|
38
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
39
|
-
}, {
|
|
40
|
-
region: string;
|
|
41
|
-
intensity: number;
|
|
42
|
-
timestamp: string;
|
|
43
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
44
|
-
}>;
|
|
39
|
+
}, z.core.$strip>;
|
|
45
40
|
type PainPoint = z.infer<typeof painPointSchema>;
|
|
46
41
|
declare const painReportSchema: z.ZodArray<z.ZodObject<{
|
|
47
|
-
region: z.
|
|
42
|
+
region: z.ZodString;
|
|
48
43
|
intensity: z.ZodNumber;
|
|
49
|
-
type: z.ZodOptional<z.ZodEnum<
|
|
44
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
stikkende: "stikkende";
|
|
46
|
+
dump: "dump";
|
|
47
|
+
konstant: "konstant";
|
|
48
|
+
jagende: "jagende";
|
|
49
|
+
}>>;
|
|
50
50
|
timestamp: z.ZodString;
|
|
51
|
-
},
|
|
52
|
-
region: string;
|
|
53
|
-
intensity: number;
|
|
54
|
-
timestamp: string;
|
|
55
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
region: string;
|
|
58
|
-
intensity: number;
|
|
59
|
-
timestamp: string;
|
|
60
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
61
|
-
}>, "many">;
|
|
51
|
+
}, z.core.$strip>>;
|
|
62
52
|
type PainReport = PainPoint[];
|
|
63
53
|
interface PainSelection {
|
|
64
54
|
/** Mark (or update) pain on a region. One point per region — latest wins. */
|
|
@@ -287,42 +277,28 @@ interface BodymapReportV1 {
|
|
|
287
277
|
}
|
|
288
278
|
declare const bodymapReportV1Schema: z.ZodObject<{
|
|
289
279
|
schema: z.ZodLiteral<"bodymap/v1">;
|
|
290
|
-
view: z.ZodEnum<
|
|
280
|
+
view: z.ZodEnum<{
|
|
281
|
+
left: "left";
|
|
282
|
+
right: "right";
|
|
283
|
+
front: "front";
|
|
284
|
+
back: "back";
|
|
285
|
+
}>;
|
|
291
286
|
points: z.ZodArray<z.ZodObject<{
|
|
292
287
|
region: z.ZodString;
|
|
293
|
-
side: z.ZodEnum<
|
|
288
|
+
side: z.ZodEnum<{
|
|
289
|
+
left: "left";
|
|
290
|
+
right: "right";
|
|
291
|
+
center: "center";
|
|
292
|
+
}>;
|
|
294
293
|
intensity: z.ZodNumber;
|
|
295
|
-
quality: z.ZodOptional<z.ZodEnum<
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
},
|
|
302
|
-
|
|
303
|
-
region: string;
|
|
304
|
-
intensity: number;
|
|
305
|
-
quality?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
306
|
-
}>, "many">;
|
|
307
|
-
}, "strip", z.ZodTypeAny, {
|
|
308
|
-
schema: "bodymap/v1";
|
|
309
|
-
view: "left" | "right" | "front" | "back";
|
|
310
|
-
points: {
|
|
311
|
-
side: "left" | "right" | "center";
|
|
312
|
-
region: string;
|
|
313
|
-
intensity: number;
|
|
314
|
-
quality?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
315
|
-
}[];
|
|
316
|
-
}, {
|
|
317
|
-
schema: "bodymap/v1";
|
|
318
|
-
view: "left" | "right" | "front" | "back";
|
|
319
|
-
points: {
|
|
320
|
-
side: "left" | "right" | "center";
|
|
321
|
-
region: string;
|
|
322
|
-
intensity: number;
|
|
323
|
-
quality?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
324
|
-
}[];
|
|
325
|
-
}>;
|
|
294
|
+
quality: z.ZodOptional<z.ZodEnum<{
|
|
295
|
+
stikkende: "stikkende";
|
|
296
|
+
dump: "dump";
|
|
297
|
+
konstant: "konstant";
|
|
298
|
+
jagende: "jagende";
|
|
299
|
+
}>>;
|
|
300
|
+
}, z.core.$strip>>;
|
|
301
|
+
}, z.core.$strip>;
|
|
326
302
|
/** Serialize a PainReport to the shared `bodymap/v1` wire format. */
|
|
327
303
|
declare function serializeReport(report: PainReport, opts?: {
|
|
328
304
|
view?: BodyView;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,38 +27,28 @@ type PainType = (typeof PAIN_TYPES)[number];
|
|
|
27
27
|
/** One marked pain point. `region` MUST be a known region key; `intensity` is a
|
|
28
28
|
* 0-10 integer; `type` is optional but constrained; `timestamp` is an ISO string. */
|
|
29
29
|
declare const painPointSchema: z.ZodObject<{
|
|
30
|
-
region: z.
|
|
30
|
+
region: z.ZodString;
|
|
31
31
|
intensity: z.ZodNumber;
|
|
32
|
-
type: z.ZodOptional<z.ZodEnum<
|
|
32
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
stikkende: "stikkende";
|
|
34
|
+
dump: "dump";
|
|
35
|
+
konstant: "konstant";
|
|
36
|
+
jagende: "jagende";
|
|
37
|
+
}>>;
|
|
33
38
|
timestamp: z.ZodString;
|
|
34
|
-
},
|
|
35
|
-
region: string;
|
|
36
|
-
intensity: number;
|
|
37
|
-
timestamp: string;
|
|
38
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
39
|
-
}, {
|
|
40
|
-
region: string;
|
|
41
|
-
intensity: number;
|
|
42
|
-
timestamp: string;
|
|
43
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
44
|
-
}>;
|
|
39
|
+
}, z.core.$strip>;
|
|
45
40
|
type PainPoint = z.infer<typeof painPointSchema>;
|
|
46
41
|
declare const painReportSchema: z.ZodArray<z.ZodObject<{
|
|
47
|
-
region: z.
|
|
42
|
+
region: z.ZodString;
|
|
48
43
|
intensity: z.ZodNumber;
|
|
49
|
-
type: z.ZodOptional<z.ZodEnum<
|
|
44
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
stikkende: "stikkende";
|
|
46
|
+
dump: "dump";
|
|
47
|
+
konstant: "konstant";
|
|
48
|
+
jagende: "jagende";
|
|
49
|
+
}>>;
|
|
50
50
|
timestamp: z.ZodString;
|
|
51
|
-
},
|
|
52
|
-
region: string;
|
|
53
|
-
intensity: number;
|
|
54
|
-
timestamp: string;
|
|
55
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
region: string;
|
|
58
|
-
intensity: number;
|
|
59
|
-
timestamp: string;
|
|
60
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
61
|
-
}>, "many">;
|
|
51
|
+
}, z.core.$strip>>;
|
|
62
52
|
type PainReport = PainPoint[];
|
|
63
53
|
interface PainSelection {
|
|
64
54
|
/** Mark (or update) pain on a region. One point per region — latest wins. */
|
|
@@ -287,42 +277,28 @@ interface BodymapReportV1 {
|
|
|
287
277
|
}
|
|
288
278
|
declare const bodymapReportV1Schema: z.ZodObject<{
|
|
289
279
|
schema: z.ZodLiteral<"bodymap/v1">;
|
|
290
|
-
view: z.ZodEnum<
|
|
280
|
+
view: z.ZodEnum<{
|
|
281
|
+
left: "left";
|
|
282
|
+
right: "right";
|
|
283
|
+
front: "front";
|
|
284
|
+
back: "back";
|
|
285
|
+
}>;
|
|
291
286
|
points: z.ZodArray<z.ZodObject<{
|
|
292
287
|
region: z.ZodString;
|
|
293
|
-
side: z.ZodEnum<
|
|
288
|
+
side: z.ZodEnum<{
|
|
289
|
+
left: "left";
|
|
290
|
+
right: "right";
|
|
291
|
+
center: "center";
|
|
292
|
+
}>;
|
|
294
293
|
intensity: z.ZodNumber;
|
|
295
|
-
quality: z.ZodOptional<z.ZodEnum<
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
},
|
|
302
|
-
|
|
303
|
-
region: string;
|
|
304
|
-
intensity: number;
|
|
305
|
-
quality?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
306
|
-
}>, "many">;
|
|
307
|
-
}, "strip", z.ZodTypeAny, {
|
|
308
|
-
schema: "bodymap/v1";
|
|
309
|
-
view: "left" | "right" | "front" | "back";
|
|
310
|
-
points: {
|
|
311
|
-
side: "left" | "right" | "center";
|
|
312
|
-
region: string;
|
|
313
|
-
intensity: number;
|
|
314
|
-
quality?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
315
|
-
}[];
|
|
316
|
-
}, {
|
|
317
|
-
schema: "bodymap/v1";
|
|
318
|
-
view: "left" | "right" | "front" | "back";
|
|
319
|
-
points: {
|
|
320
|
-
side: "left" | "right" | "center";
|
|
321
|
-
region: string;
|
|
322
|
-
intensity: number;
|
|
323
|
-
quality?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
324
|
-
}[];
|
|
325
|
-
}>;
|
|
294
|
+
quality: z.ZodOptional<z.ZodEnum<{
|
|
295
|
+
stikkende: "stikkende";
|
|
296
|
+
dump: "dump";
|
|
297
|
+
konstant: "konstant";
|
|
298
|
+
jagende: "jagende";
|
|
299
|
+
}>>;
|
|
300
|
+
}, z.core.$strip>>;
|
|
301
|
+
}, z.core.$strip>;
|
|
326
302
|
/** Serialize a PainReport to the shared `bodymap/v1` wire format. */
|
|
327
303
|
declare function serializeReport(report: PainReport, opts?: {
|
|
328
304
|
view?: BodyView;
|
package/dist/react.d.cts
CHANGED
|
@@ -4,21 +4,16 @@ import { z } from 'zod';
|
|
|
4
4
|
/** One marked pain point. `region` MUST be a known region key; `intensity` is a
|
|
5
5
|
* 0-10 integer; `type` is optional but constrained; `timestamp` is an ISO string. */
|
|
6
6
|
declare const painPointSchema: z.ZodObject<{
|
|
7
|
-
region: z.
|
|
7
|
+
region: z.ZodString;
|
|
8
8
|
intensity: z.ZodNumber;
|
|
9
|
-
type: z.ZodOptional<z.ZodEnum<
|
|
9
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
stikkende: "stikkende";
|
|
11
|
+
dump: "dump";
|
|
12
|
+
konstant: "konstant";
|
|
13
|
+
jagende: "jagende";
|
|
14
|
+
}>>;
|
|
10
15
|
timestamp: z.ZodString;
|
|
11
|
-
},
|
|
12
|
-
intensity: number;
|
|
13
|
-
region: string;
|
|
14
|
-
timestamp: string;
|
|
15
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
intensity: number;
|
|
18
|
-
region: string;
|
|
19
|
-
timestamp: string;
|
|
20
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
21
|
-
}>;
|
|
16
|
+
}, z.core.$strip>;
|
|
22
17
|
type PainPoint = z.infer<typeof painPointSchema>;
|
|
23
18
|
type PainReport = PainPoint[];
|
|
24
19
|
interface RegionSetting {
|
package/dist/react.d.ts
CHANGED
|
@@ -4,21 +4,16 @@ import { z } from 'zod';
|
|
|
4
4
|
/** One marked pain point. `region` MUST be a known region key; `intensity` is a
|
|
5
5
|
* 0-10 integer; `type` is optional but constrained; `timestamp` is an ISO string. */
|
|
6
6
|
declare const painPointSchema: z.ZodObject<{
|
|
7
|
-
region: z.
|
|
7
|
+
region: z.ZodString;
|
|
8
8
|
intensity: z.ZodNumber;
|
|
9
|
-
type: z.ZodOptional<z.ZodEnum<
|
|
9
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
stikkende: "stikkende";
|
|
11
|
+
dump: "dump";
|
|
12
|
+
konstant: "konstant";
|
|
13
|
+
jagende: "jagende";
|
|
14
|
+
}>>;
|
|
10
15
|
timestamp: z.ZodString;
|
|
11
|
-
},
|
|
12
|
-
intensity: number;
|
|
13
|
-
region: string;
|
|
14
|
-
timestamp: string;
|
|
15
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
intensity: number;
|
|
18
|
-
region: string;
|
|
19
|
-
timestamp: string;
|
|
20
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
21
|
-
}>;
|
|
16
|
+
}, z.core.$strip>;
|
|
22
17
|
type PainPoint = z.infer<typeof painPointSchema>;
|
|
23
18
|
type PainReport = PainPoint[];
|
|
24
19
|
interface RegionSetting {
|
package/dist/three.d.cts
CHANGED
|
@@ -6,21 +6,16 @@ type PainType = (typeof PAIN_TYPES)[number];
|
|
|
6
6
|
/** One marked pain point. `region` MUST be a known region key; `intensity` is a
|
|
7
7
|
* 0-10 integer; `type` is optional but constrained; `timestamp` is an ISO string. */
|
|
8
8
|
declare const painPointSchema: z.ZodObject<{
|
|
9
|
-
region: z.
|
|
9
|
+
region: z.ZodString;
|
|
10
10
|
intensity: z.ZodNumber;
|
|
11
|
-
type: z.ZodOptional<z.ZodEnum<
|
|
11
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
stikkende: "stikkende";
|
|
13
|
+
dump: "dump";
|
|
14
|
+
konstant: "konstant";
|
|
15
|
+
jagende: "jagende";
|
|
16
|
+
}>>;
|
|
12
17
|
timestamp: z.ZodString;
|
|
13
|
-
},
|
|
14
|
-
intensity: number;
|
|
15
|
-
region: string;
|
|
16
|
-
timestamp: string;
|
|
17
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
intensity: number;
|
|
20
|
-
region: string;
|
|
21
|
-
timestamp: string;
|
|
22
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
23
|
-
}>;
|
|
18
|
+
}, z.core.$strip>;
|
|
24
19
|
type PainPoint = z.infer<typeof painPointSchema>;
|
|
25
20
|
type PainReport = PainPoint[];
|
|
26
21
|
interface RegionSetting {
|
package/dist/three.d.ts
CHANGED
|
@@ -6,21 +6,16 @@ type PainType = (typeof PAIN_TYPES)[number];
|
|
|
6
6
|
/** One marked pain point. `region` MUST be a known region key; `intensity` is a
|
|
7
7
|
* 0-10 integer; `type` is optional but constrained; `timestamp` is an ISO string. */
|
|
8
8
|
declare const painPointSchema: z.ZodObject<{
|
|
9
|
-
region: z.
|
|
9
|
+
region: z.ZodString;
|
|
10
10
|
intensity: z.ZodNumber;
|
|
11
|
-
type: z.ZodOptional<z.ZodEnum<
|
|
11
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
stikkende: "stikkende";
|
|
13
|
+
dump: "dump";
|
|
14
|
+
konstant: "konstant";
|
|
15
|
+
jagende: "jagende";
|
|
16
|
+
}>>;
|
|
12
17
|
timestamp: z.ZodString;
|
|
13
|
-
},
|
|
14
|
-
intensity: number;
|
|
15
|
-
region: string;
|
|
16
|
-
timestamp: string;
|
|
17
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
intensity: number;
|
|
20
|
-
region: string;
|
|
21
|
-
timestamp: string;
|
|
22
|
-
type?: "stikkende" | "dump" | "konstant" | "jagende" | undefined;
|
|
23
|
-
}>;
|
|
18
|
+
}, z.core.$strip>;
|
|
24
19
|
type PainPoint = z.infer<typeof painPointSchema>;
|
|
25
20
|
type PainReport = PainPoint[];
|
|
26
21
|
interface RegionSetting {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@broberg/bodymap",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Interactive body pain-map: a body a patient clicks to mark where it hurts, producing a structured PainReport (bodymap/v1). Framework-neutral core (region taxonomy + zod PainReport model + selection) + a 2D SVG React renderer + a rotatable 3D renderer (vanilla three.js) on the SAME core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,15 +29,16 @@
|
|
|
29
29
|
"import": "./dist/three.js",
|
|
30
30
|
"require": "./dist/three.cjs"
|
|
31
31
|
},
|
|
32
|
-
"./models/*": "./models/*"
|
|
32
|
+
"./models/*": "./models/*",
|
|
33
|
+
"./package.json": "./package.json"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
35
36
|
"build": "rm -rf dist && tsup && node verify-exports.mjs",
|
|
36
|
-
"test": "vitest run",
|
|
37
|
+
"test": "vitest run --reporter=default --reporter=json --outputFile.json=.vitest-report/results.json",
|
|
37
38
|
"typecheck": "tsc --noEmit"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
|
-
"zod": "^
|
|
41
|
+
"zod": "^4.6.7"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
44
|
"react": ">=18.0.0",
|