@mathscan/math-exercise-engine 1.0.16 → 1.1.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/index.d.ts +228 -0
- package/dist/index.js +84 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +84 -35
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +36 -29
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -107,12 +107,13 @@
|
|
|
107
107
|
NUMBER LINE — HIGHLIGHT COLORS
|
|
108
108
|
======================================== */
|
|
109
109
|
|
|
110
|
-
--nl-
|
|
111
|
-
--nl-highlight-
|
|
112
|
-
--nl-highlight-
|
|
113
|
-
--nl-highlight-
|
|
114
|
-
--nl-highlight-
|
|
115
|
-
--nl-highlight-
|
|
110
|
+
--nl-axis-color: #705DC0;
|
|
111
|
+
--nl-highlight-blue: #007ACC;
|
|
112
|
+
--nl-highlight-red: #EF4444;
|
|
113
|
+
--nl-highlight-green: #22C55E;
|
|
114
|
+
--nl-highlight-orange: #F97316;
|
|
115
|
+
--nl-highlight-purple: #705DC0;
|
|
116
|
+
--nl-highlight-yellow: #FFD700;
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
/* Layout & Structure */
|
|
@@ -238,6 +239,10 @@
|
|
|
238
239
|
unicode-bidi: plaintext;
|
|
239
240
|
}
|
|
240
241
|
|
|
242
|
+
.text-item-number {
|
|
243
|
+
font-variant-numeric: tabular-nums;
|
|
244
|
+
}
|
|
245
|
+
|
|
241
246
|
.text-item-arabic {
|
|
242
247
|
/* Direction is handled by parent text-group with unicode-bidi: plaintext */
|
|
243
248
|
}
|
|
@@ -707,7 +712,6 @@ th.exercise-table-cell {
|
|
|
707
712
|
}
|
|
708
713
|
|
|
709
714
|
.fraction-input {
|
|
710
|
-
width: 3.2em !important;
|
|
711
715
|
padding: 0.15em 0.2em;
|
|
712
716
|
font-size: 0.9em;
|
|
713
717
|
text-align: center;
|
|
@@ -758,22 +762,20 @@ th.exercise-table-cell {
|
|
|
758
762
|
}
|
|
759
763
|
|
|
760
764
|
.visual-fraction-widget__parts--horizontal {
|
|
761
|
-
grid-template-columns: repeat(var(--visual-fraction-divisions, 1),
|
|
765
|
+
grid-template-columns: repeat(var(--visual-fraction-divisions, 1), 1fr);
|
|
762
766
|
grid-template-rows: var(--visual-fraction-part-size);
|
|
763
|
-
width:
|
|
767
|
+
width: var(--visual-fraction-size);
|
|
764
768
|
}
|
|
765
769
|
|
|
766
770
|
.visual-fraction-widget__parts--vertical {
|
|
767
|
-
grid-template-columns:
|
|
768
|
-
grid-template-rows: repeat(var(--visual-fraction-divisions, 1),
|
|
769
|
-
|
|
770
|
-
height: max-content;
|
|
771
|
+
grid-template-columns: var(--visual-fraction-part-size);
|
|
772
|
+
grid-template-rows: repeat(var(--visual-fraction-divisions, 1), 1fr);
|
|
773
|
+
height: var(--visual-fraction-size);
|
|
771
774
|
}
|
|
772
775
|
|
|
773
776
|
.visual-fraction-widget__part {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
height: var(--visual-fraction-part-size);
|
|
777
|
+
min-width: 0;
|
|
778
|
+
min-height: 0;
|
|
777
779
|
background: var(--visual-fraction-empty-bg);
|
|
778
780
|
color: var(--exercise-text, #333);
|
|
779
781
|
transition: background 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
|
|
@@ -858,8 +860,10 @@ th.exercise-table-cell {
|
|
|
858
860
|
}
|
|
859
861
|
|
|
860
862
|
.visual-fraction-widget--grid .visual-fraction-widget__parts {
|
|
861
|
-
grid-template-columns: repeat(var(--visual-fraction-grid-cols, 3),
|
|
862
|
-
|
|
863
|
+
grid-template-columns: repeat(var(--visual-fraction-grid-cols, 3), 1fr);
|
|
864
|
+
grid-template-rows: repeat(var(--visual-fraction-grid-rows, 3), 1fr);
|
|
865
|
+
width: var(--visual-fraction-size);
|
|
866
|
+
height: var(--visual-fraction-size);
|
|
863
867
|
}
|
|
864
868
|
|
|
865
869
|
.visual-fraction-widget__label {
|
|
@@ -1024,7 +1028,7 @@ th.exercise-table-cell {
|
|
|
1024
1028
|
right: var(--nl-side-pad, 7%);
|
|
1025
1029
|
top: 50%;
|
|
1026
1030
|
height: 2px;
|
|
1027
|
-
background-color: var(--
|
|
1031
|
+
background-color: var(--nl-axis-color);
|
|
1028
1032
|
transform: translateY(-50%);
|
|
1029
1033
|
/* transition on base state so both enter and exit are smooth */
|
|
1030
1034
|
transition: all 0.2s ease;
|
|
@@ -1065,7 +1069,7 @@ th.exercise-table-cell {
|
|
|
1065
1069
|
transform: translateY(-50%);
|
|
1066
1070
|
border-top: 5px solid transparent;
|
|
1067
1071
|
border-bottom: 5px solid transparent;
|
|
1068
|
-
border-left: 8px solid var(--
|
|
1072
|
+
border-left: 8px solid var(--nl-axis-color);
|
|
1069
1073
|
}
|
|
1070
1074
|
|
|
1071
1075
|
/* Left-pointing arrow — tip extends just past the left end of the track, offset outward by --nl-arrow-gap */
|
|
@@ -1075,7 +1079,7 @@ th.exercise-table-cell {
|
|
|
1075
1079
|
transform: translate(-100%, -50%);
|
|
1076
1080
|
border-top: 5px solid transparent;
|
|
1077
1081
|
border-bottom: 5px solid transparent;
|
|
1078
|
-
border-right: 8px solid var(--
|
|
1082
|
+
border-right: 8px solid var(--nl-axis-color);
|
|
1079
1083
|
}
|
|
1080
1084
|
|
|
1081
1085
|
/* Geometric line style — arrows reach the full container edges */
|
|
@@ -1096,7 +1100,8 @@ th.exercise-table-cell {
|
|
|
1096
1100
|
transform: translate(-50%, -50%);
|
|
1097
1101
|
width: 2px;
|
|
1098
1102
|
height: 14px;
|
|
1099
|
-
background-color: var(--
|
|
1103
|
+
background-color: var(--nl-axis-color);
|
|
1104
|
+
z-index: 2;
|
|
1100
1105
|
transition: transform 0.1s ease, background-color 0.1s ease, width 0.1s ease;
|
|
1101
1106
|
}
|
|
1102
1107
|
|
|
@@ -1108,7 +1113,8 @@ th.exercise-table-cell {
|
|
|
1108
1113
|
transform: translate(-50%, -50%);
|
|
1109
1114
|
width: 1px;
|
|
1110
1115
|
height: 8px;
|
|
1111
|
-
background-color: var(--
|
|
1116
|
+
background-color: var(--nl-axis-color);
|
|
1117
|
+
z-index: 2;
|
|
1112
1118
|
transition: transform 0.1s ease, background-color 0.1s ease, width 0.1s ease;
|
|
1113
1119
|
}
|
|
1114
1120
|
|
|
@@ -1306,7 +1312,7 @@ th.exercise-table-cell {
|
|
|
1306
1312
|
transform: translateX(-50%);
|
|
1307
1313
|
/** Slightly smaller than base font — same pattern as secondary text in the app */
|
|
1308
1314
|
font-size: calc(var(--exercise-font-size) * 0.8);
|
|
1309
|
-
color: var(--
|
|
1315
|
+
color: var(--nl-axis-color);
|
|
1310
1316
|
white-space: nowrap;
|
|
1311
1317
|
}
|
|
1312
1318
|
|
|
@@ -1318,11 +1324,12 @@ th.exercise-table-cell {
|
|
|
1318
1324
|
|
|
1319
1325
|
.number-line-highlight-band {
|
|
1320
1326
|
position: absolute;
|
|
1321
|
-
top:
|
|
1322
|
-
height:
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1327
|
+
top: 50%;
|
|
1328
|
+
height: 6px;
|
|
1329
|
+
transform: translateY(-50%);
|
|
1330
|
+
background-color: var(--nl-highlight-color, var(--nl-highlight-purple, #705DC0));
|
|
1331
|
+
border-radius: 0;
|
|
1332
|
+
z-index: 1;
|
|
1326
1333
|
pointer-events: none;
|
|
1327
1334
|
}
|
|
1328
1335
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mathscan/math-exercise-engine",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.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",
|