@mathscan/math-exercise-engine 1.2.6 → 1.2.8

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
@@ -60,6 +60,10 @@
60
60
  --exercise-incorrect: #ef4444;
61
61
  --exercise-correct-bg: color-mix(in srgb, var(--exercise-correct) 6%, var(--exercise-bg));
62
62
  --exercise-incorrect-bg: color-mix(in srgb, var(--exercise-incorrect) 6%, var(--exercise-bg));
63
+ /* Disabled inputs: a visible slot the student can't fill. Derived from the
64
+ base tokens so they follow the host theme. */
65
+ --exercise-disabled-bg: color-mix(in srgb, var(--exercise-border) 40%, var(--exercise-bg));
66
+ --exercise-disabled-border: var(--exercise-border);
63
67
  /* Authoring/engine errors — kept apart from --exercise-incorrect so they
64
68
  don't follow the student's attempt state. */
65
69
  --exercise-error: #ef4444;
@@ -496,6 +500,21 @@ mark {
496
500
  border-color: var(--exercise-border-focus);
497
501
  }
498
502
 
503
+ /* ========================================
504
+ DISABLED
505
+ Prefixed with .math-exercise-renderer so a host's own .inline-input CSS can't override the gray.
506
+ To change the colors, override the --exercise-disabled-* variables instead.
507
+ ======================================== */
508
+
509
+ .math-exercise-renderer .inline-input.inline-input--disabled:disabled {
510
+ background: var(--exercise-disabled-bg);
511
+ border: var(--exercise-border-width) solid var(--exercise-disabled-border);
512
+ box-shadow: none;
513
+ cursor: not-allowed;
514
+ /* Cancel the browser's default fade: the gray tokens already convey it. */
515
+ opacity: 1;
516
+ }
517
+
499
518
  /* ========================================
500
519
  VALIDATION STATUS
501
520
  ======================================== */
@@ -1068,7 +1087,8 @@ th.exercise-table-cell.exercise-table-cell--last-row:last-child {
1068
1087
  .matcher-widget {
1069
1088
  display: flex;
1070
1089
  flex-direction: column;
1071
- gap: clamp(10px, 2.5vw, 16px);
1090
+ gap: clamp(6px, min(max(10px, 2.5vw), 2.5vh), 16px);
1091
+ gap: clamp(6px, min(max(10px, 2.5vw), 2.5dvh), 16px);
1072
1092
  width: min(100%, 580px);
1073
1093
  margin-inline: auto;
1074
1094
  }
@@ -1076,15 +1096,20 @@ th.exercise-table-cell.exercise-table-cell--last-row:last-child {
1076
1096
  .matcher-row {
1077
1097
  display: grid;
1078
1098
  grid-template-columns: repeat(var(--matcher-cols, 3), minmax(0, 1fr));
1079
- gap: clamp(10px, 2.5vw, 16px);
1099
+ gap: clamp(6px, min(max(10px, 2.5vw), 2.5vh), 16px);
1100
+ gap: clamp(6px, min(max(10px, 2.5vw), 2.5dvh), 16px);
1080
1101
  }
1081
1102
 
1082
1103
  .matcher-card {
1083
1104
  display: flex;
1084
1105
  align-items: center;
1085
1106
  justify-content: center;
1086
- min-height: clamp(72px, 14vw, 96px);
1087
- padding: clamp(8px, 2vw, 12px);
1107
+ /* Bounded by viewport height too, so 3 rows fit on landscape phones (~330px tall).
1108
+ vh lines are fallbacks for WebViews without dvh support. */
1109
+ min-height: clamp(44px, min(max(72px, 14vw), 15vh), 96px);
1110
+ min-height: clamp(44px, min(max(72px, 14vw), 15dvh), 96px);
1111
+ padding: clamp(4px, min(max(8px, 2vw), 1.5vh), 12px);
1112
+ padding: clamp(4px, min(max(8px, 2vw), 1.5dvh), 12px);
1088
1113
  border: 2px solid #ffca76;
1089
1114
  border-radius: clamp(12px, 3vw, 17px);
1090
1115
  background: #ffffff;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathscan/math-exercise-engine",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
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",