@pie-element/venn-classification 0.1.1-next.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.
@@ -0,0 +1,12 @@
1
+ export declare const runtimeSupport: {
2
+ schemaVersion: number;
3
+ packageName: string;
4
+ supports: {
5
+ esm: {
6
+ delivery: boolean;
7
+ author: boolean;
8
+ print: boolean;
9
+ };
10
+ };
11
+ };
12
+ export default runtimeSupport;
@@ -0,0 +1,14 @@
1
+ //#region src/runtime-support.ts
2
+ var e = {
3
+ schemaVersion: 1,
4
+ packageName: "@pie-element/venn-classification",
5
+ supports: { esm: {
6
+ delivery: !1,
7
+ author: !1,
8
+ print: !1
9
+ } }
10
+ };
11
+ //#endregion
12
+ export { e as default, e as runtimeSupport };
13
+
14
+ //# sourceMappingURL=runtime-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-support.js","names":[],"sources":["../src/runtime-support.ts"],"sourcesContent":["export const runtimeSupport = {\n schemaVersion: 1,\n packageName: '@pie-element/venn-classification',\n supports: {\n esm: {\n delivery: false,\n author: false,\n print: false,\n },\n },\n};\n\nexport default runtimeSupport;\n"],"mappings":";AAAA,IAAa,IAAiB;CAC5B,eAAe;CACf,aAAa;CACb,UAAU,EACR,KAAK;EACH,UAAU;EACV,QAAQ;EACR,OAAO;CACT,EACF;AACF"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Shared types for the venn-classification element.
3
+ *
4
+ * A region is a sorted-ascending array of circle indexes:
5
+ * [] = outside (neither)
6
+ * [0] = circle 0 only
7
+ * [0, 1] = overlap of circles 0 and 1
8
+ * [0, 1, 2] = triple overlap (3-set, v2)
9
+ */
10
+ export type Region = number[];
11
+ export type ScoringPolicy = 'allOrNothing' | 'partialPerTile';
12
+ export interface VennCircle {
13
+ label: string;
14
+ }
15
+ export interface VennTile {
16
+ id: string;
17
+ label: string;
18
+ /** Optional tile image (URL or data URI). When set, `imageAlt` should describe the image for accessibility. */
19
+ imageUrl?: string;
20
+ /** Short description when `imageUrl` is set (used for aria-label / announcements). */
21
+ imageAlt?: string;
22
+ correctRegion: Region;
23
+ }
24
+ export interface VennModel {
25
+ id?: string;
26
+ element?: string;
27
+ prompt?: string;
28
+ promptEnabled?: boolean;
29
+ circles: VennCircle[];
30
+ tiles: VennTile[];
31
+ /**
32
+ * Optional per-region label overrides. Keyed by the sorted, comma-joined region key:
33
+ * "" = outside
34
+ * "0" = circle 0 only
35
+ * "0,1" = overlap of 0 and 1
36
+ * "0,1,2" = triple overlap
37
+ */
38
+ regionLabels?: Record<string, string>;
39
+ scoringPolicy?: ScoringPolicy;
40
+ }
41
+ export interface VennSession {
42
+ id?: string;
43
+ element?: string;
44
+ /** Keyed by tile id; `null` = still in tray, `[]` = outside region. */
45
+ placements?: Record<string, Region | null>;
46
+ completed?: boolean;
47
+ }
48
+ export interface VennViewModel {
49
+ prompt: string | null;
50
+ circles: VennCircle[];
51
+ tiles: Array<{
52
+ id: string;
53
+ label: string;
54
+ imageUrl?: string;
55
+ imageAlt?: string;
56
+ correctRegion?: Region;
57
+ }>;
58
+ regionLabels: Record<string, string>;
59
+ scoringPolicy: ScoringPolicy;
60
+ disabled: boolean;
61
+ mode: string | undefined;
62
+ env: unknown;
63
+ correctRegionsById?: Record<string, Region>;
64
+ correctness?: Record<string, 'correct' | 'incorrect' | 'unanswered'>;
65
+ teacherInstructions?: string | null;
66
+ }
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@pie-element/venn-classification",
3
+ "version": "0.1.1-next.0",
4
+ "description": "Venn diagram classification PIE element (Svelte 5) with 2-set classification, tile tray, optional tile images, pointer + keyboard placement, and MathJax-rendered math tile labels",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "pie": {
9
+ "controller": "@pie-element/venn-classification/controller",
10
+ "configure": "@pie-element/venn-classification/configure"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "./delivery": {
18
+ "types": "./dist/delivery/index.d.ts",
19
+ "default": "./dist/delivery/index.js"
20
+ },
21
+ "./controller": {
22
+ "types": "./dist/controller/index.d.ts",
23
+ "default": "./dist/controller/index.js"
24
+ },
25
+ "./controller.js": {
26
+ "types": "./dist/controller/index.d.ts",
27
+ "default": "./dist/controller/index.js"
28
+ },
29
+ "./author": {
30
+ "types": "./dist/author/index.d.ts",
31
+ "default": "./dist/author/index.js"
32
+ },
33
+ "./configure": {
34
+ "types": "./dist/author/index.d.ts",
35
+ "default": "./dist/author/index.js"
36
+ },
37
+ "./runtime-support": {
38
+ "types": "./dist/runtime-support.d.ts",
39
+ "default": "./dist/runtime-support.js"
40
+ }
41
+ },
42
+ "files": [
43
+ "configure.js",
44
+ "controller.js",
45
+ "dist"
46
+ ],
47
+ "sideEffects": false,
48
+ "scripts": {
49
+ "build": "vite build && vite build --config vite.delivery.config.ts && vite build --config vite.controller.config.ts && vite build --config vite.author.config.ts && vite build --config vite.runtime-support.config.ts && vite build --config vite.config.iife.ts && tsc --emitDeclarationOnly",
50
+ "dev": "vite",
51
+ "test": "vitest run",
52
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
53
+ },
54
+ "devDependencies": {
55
+ "@pie-element/shared-math-rendering-mathjax": "0.1.0",
56
+ "@pie-lib/delivery-events-svelte": "0.1.0",
57
+ "@pie-lib/editable-html-tiptap-svelte": "0.1.2",
58
+ "@pie-lib/styling-svelte": "0.1.2",
59
+ "@sveltejs/vite-plugin-svelte": "^7.0.0",
60
+ "@tiptap/core": "^3.19.0",
61
+ "@tiptap/pm": "^3.19.0",
62
+ "@tiptap/starter-kit": "^3.19.0",
63
+ "svelte": "^5.54.0",
64
+ "typescript": "^5.9.3",
65
+ "vite": "^8.0.1",
66
+ "vitest": "^4.1.0"
67
+ }
68
+ }