@mathscan/math-exercise-engine 1.1.17 → 1.2.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/dist/style.css CHANGED
@@ -1351,6 +1351,32 @@ th.exercise-table-cell.exercise-table-cell--last-row:last-child {
1351
1351
  }
1352
1352
  }
1353
1353
 
1354
+ /* ============================================
1355
+ LOCKED EXERCISE (answers checked or revealed)
1356
+ Widgets refuse input in JS; these rules kill the pointer
1357
+ cursor that suggests otherwise. Cursor only — never `transform`,
1358
+ which would override rotations like `.diamond-keypad .keypad-btn`.
1359
+ Reset() removes `.locked` and everything comes back.
1360
+ ============================================ */
1361
+
1362
+ .math-exercise-renderer.locked .inline-input,
1363
+ .math-exercise-renderer.locked .inline-input-chip,
1364
+ .math-exercise-renderer.locked .radio-option,
1365
+ .math-exercise-renderer.locked .drag-option,
1366
+ .math-exercise-renderer.locked .matcher-card,
1367
+ .math-exercise-renderer.locked .pair-matcher-card,
1368
+ .math-exercise-renderer.locked .keypad-btn,
1369
+ .math-exercise-renderer.locked .grid-symmetry__cell--editable,
1370
+ .math-exercise-renderer.locked .visual-fraction-widget__part,
1371
+ .math-exercise-renderer.locked .number-line-cursor-ball,
1372
+ .math-exercise-renderer.locked .number-line-placed-chip-btn,
1373
+ /* .clock-hand, not .clock-arrow: the arrow polygons are pointer-events:none,
1374
+ the transparent hit-target lines are what carry the grab cursor. */
1375
+ .math-exercise-renderer.locked .clock-interactive .clock-hand,
1376
+ .math-exercise-renderer.locked .clock-interactive .clock-hand:active {
1377
+ cursor: default;
1378
+ }
1379
+
1354
1380
  /**
1355
1381
  * Image Styles
1356
1382
  *
@@ -2546,6 +2572,20 @@ th.exercise-table-cell.exercise-table-cell--last-row:last-child {
2546
2572
  transform: scale(0.98);
2547
2573
  }
2548
2574
 
2575
+ /* Locked exercise — the button is disabled until reset(). */
2576
+
2577
+ .exercise-submit-btn:disabled,
2578
+ .exercise-submit-btn:disabled:hover {
2579
+ cursor: default;
2580
+ opacity: 0.5;
2581
+ background: var(--exercise-primary);
2582
+ color: white;
2583
+ }
2584
+
2585
+ .exercise-submit-btn:disabled:active {
2586
+ transform: none;
2587
+ }
2588
+
2549
2589
  /* Responsive Overrides - must be last */
2550
2590
 
2551
2591
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathscan/math-exercise-engine",
3
- "version": "1.1.17",
3
+ "version": "1.2.0",
4
4
  "description": "A DSL parser and validator for math exercises - transforms text-based exercise definitions into structured AST and JSON",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -16,23 +16,6 @@
16
16
  "files": [
17
17
  "dist"
18
18
  ],
19
- "scripts": {
20
- "build": "vite build",
21
- "dev": "vite build --watch",
22
- "playground": "vite --open /playground/grid-symmetry-builder/",
23
- "demo": "node examples/demo.mjs",
24
- "demo:ts": "tsx --conditions=import examples/demo.ts",
25
- "demo:build": "pnpm run build && node examples/demo.mjs",
26
- "test": "vitest",
27
- "test:run": "vitest run",
28
- "test:coverage": "vitest run --coverage",
29
- "lint": "echo 'ESLint disabled for now'",
30
- "lint:fix": "echo 'ESLint disabled for now'",
31
- "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" \"*.{json,md}\"",
32
- "format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\" \"*.{json,md}\"",
33
- "typecheck": "tsc --noEmit",
34
- "prepublishOnly": "pnpm run build"
35
- },
36
19
  "keywords": [
37
20
  "math",
38
21
  "exercise",
@@ -91,5 +74,21 @@
91
74
  "engines": {
92
75
  "node": ">=18.0.0"
93
76
  },
94
- "packageManager": "pnpm@8.15.0"
95
- }
77
+ "packageManager": "pnpm@8.15.0",
78
+ "scripts": {
79
+ "build": "vite build",
80
+ "dev": "vite build --watch",
81
+ "playground": "vite --open /playground/grid-symmetry-builder/",
82
+ "demo": "node examples/demo.mjs",
83
+ "demo:ts": "tsx --conditions=import examples/demo.ts",
84
+ "demo:build": "pnpm run build && node examples/demo.mjs",
85
+ "test": "vitest",
86
+ "test:run": "vitest run",
87
+ "test:coverage": "vitest run --coverage",
88
+ "lint": "echo 'ESLint disabled for now'",
89
+ "lint:fix": "echo 'ESLint disabled for now'",
90
+ "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" \"*.{json,md}\"",
91
+ "format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\" \"*.{json,md}\"",
92
+ "typecheck": "tsc --noEmit"
93
+ }
94
+ }