@mathscan/math-exercise-engine 1.1.13 → 1.1.15
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 +129 -0
- package/dist/index.js +64 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -28
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +202 -57
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -546,7 +546,7 @@ mark {
|
|
|
546
546
|
}
|
|
547
547
|
|
|
548
548
|
.pill-bg-path {
|
|
549
|
-
fill: var(--exercise-pill-bg, #
|
|
549
|
+
fill: var(--exercise-pill-bg, #ffe7b4);
|
|
550
550
|
}
|
|
551
551
|
|
|
552
552
|
/*
|
|
@@ -780,10 +780,8 @@ button.drag-option {
|
|
|
780
780
|
|
|
781
781
|
.exercise-table {
|
|
782
782
|
border-spacing: 0;
|
|
783
|
-
border: 2px solid var(--exercise-table-border, #8b7ec8);
|
|
784
|
-
border-radius: 12px;
|
|
785
|
-
overflow: hidden;
|
|
786
783
|
font-size: small;
|
|
784
|
+
width: 100%;
|
|
787
785
|
}
|
|
788
786
|
|
|
789
787
|
.exercise-table-cell {
|
|
@@ -801,12 +799,32 @@ button.drag-option {
|
|
|
801
799
|
}
|
|
802
800
|
|
|
803
801
|
table.exercise-table {
|
|
804
|
-
border-collapse:
|
|
802
|
+
border-collapse: separate;
|
|
803
|
+
border-spacing: 0;
|
|
805
804
|
}
|
|
806
805
|
|
|
807
806
|
td.exercise-table-cell,
|
|
808
807
|
th.exercise-table-cell {
|
|
809
|
-
|
|
808
|
+
box-shadow: inset -2px -2px 0 0 #7c6cf2;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
td.exercise-table-cell:last-child,
|
|
812
|
+
th.exercise-table-cell:last-child {
|
|
813
|
+
box-shadow: inset 0 -2px 0 0 #7c6cf2;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
tr.exercise-table-row:last-child td.exercise-table-cell,
|
|
817
|
+
tr.exercise-table-row:last-child th.exercise-table-cell,
|
|
818
|
+
td.exercise-table-cell.exercise-table-cell--last-row,
|
|
819
|
+
th.exercise-table-cell.exercise-table-cell--last-row {
|
|
820
|
+
box-shadow: inset -2px 0 0 0 #7c6cf2;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
tr.exercise-table-row:last-child td.exercise-table-cell:last-child,
|
|
824
|
+
tr.exercise-table-row:last-child th.exercise-table-cell:last-child,
|
|
825
|
+
td.exercise-table-cell.exercise-table-cell--last-row:last-child,
|
|
826
|
+
th.exercise-table-cell.exercise-table-cell--last-row:last-child {
|
|
827
|
+
box-shadow: none;
|
|
810
828
|
}
|
|
811
829
|
|
|
812
830
|
/* ========================================
|
|
@@ -968,11 +986,11 @@ th.exercise-table-cell {
|
|
|
968
986
|
fill: var(--visual-fraction-hover-color);
|
|
969
987
|
}
|
|
970
988
|
|
|
971
|
-
.visual-fraction-widget__sector[role=
|
|
989
|
+
.visual-fraction-widget__sector[role='button']:focus {
|
|
972
990
|
outline: none;
|
|
973
991
|
}
|
|
974
992
|
|
|
975
|
-
.visual-fraction-widget__sector[role=
|
|
993
|
+
.visual-fraction-widget__sector[role='button']:focus-visible {
|
|
976
994
|
/* Keyboard-only focus indicator: a drop-shadow that follows the SVG shape
|
|
977
995
|
instead of a rectangle, preserving accessibility without the visual glitch. */
|
|
978
996
|
outline: none;
|
|
@@ -1106,102 +1124,229 @@ th.exercise-table-cell {
|
|
|
1106
1124
|
======================================== */
|
|
1107
1125
|
|
|
1108
1126
|
.pair-matcher-widget {
|
|
1109
|
-
--pm-orange: #
|
|
1110
|
-
--pm-
|
|
1111
|
-
--pm-
|
|
1112
|
-
--pm-
|
|
1113
|
-
--pm-
|
|
1114
|
-
|
|
1115
|
-
|
|
1127
|
+
--pm-orange: #ffca76;
|
|
1128
|
+
--pm-purple: #705dc0;
|
|
1129
|
+
--pm-selected-bg: #e7e2ff;
|
|
1130
|
+
--pm-selected-border: #ae9cff;
|
|
1131
|
+
--pm-card-width: 163px;
|
|
1132
|
+
--pm-card-height: 82px;
|
|
1133
|
+
--pm-card-radius: 12px;
|
|
1134
|
+
--pm-card-border-width: 1px;
|
|
1135
|
+
--pm-dot-size: 17px;
|
|
1136
|
+
--pm-dot-border-width: 2px;
|
|
1137
|
+
--pm-line-color: var(--pm-orange);
|
|
1138
|
+
--pm-line-color-correct: #43b925;
|
|
1139
|
+
--pm-line-color-incorrect: #d6234d;
|
|
1140
|
+
--pm-line-width: 4px;
|
|
1141
|
+
position: relative;
|
|
1142
|
+
display: flex;
|
|
1143
|
+
flex-direction: column;
|
|
1144
|
+
gap: 52px;
|
|
1145
|
+
width: max-content;
|
|
1146
|
+
max-width: 100%;
|
|
1147
|
+
margin-inline: auto;
|
|
1148
|
+
padding: 0;
|
|
1116
1149
|
}
|
|
1117
1150
|
|
|
1118
1151
|
.pair-matcher-row {
|
|
1119
|
-
position: relative;
|
|
1152
|
+
position: relative;
|
|
1153
|
+
z-index: 2;
|
|
1154
|
+
display: grid;
|
|
1120
1155
|
grid-template-columns: repeat(var(--pm-cols, 3), minmax(0, var(--pm-card-width)));
|
|
1121
|
-
justify-content: center;
|
|
1156
|
+
justify-content: center;
|
|
1157
|
+
gap: 18px;
|
|
1158
|
+
align-items: stretch;
|
|
1159
|
+
min-width: 0;
|
|
1122
1160
|
}
|
|
1123
1161
|
|
|
1124
|
-
.pair-matcher-cell {
|
|
1162
|
+
.pair-matcher-cell {
|
|
1163
|
+
display: flex;
|
|
1164
|
+
flex-direction: column;
|
|
1165
|
+
align-items: center;
|
|
1166
|
+
min-width: 0;
|
|
1167
|
+
}
|
|
1125
1168
|
|
|
1126
1169
|
.pair-matcher-card {
|
|
1127
|
-
box-sizing: border-box;
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1170
|
+
box-sizing: border-box;
|
|
1171
|
+
display: flex;
|
|
1172
|
+
align-items: center;
|
|
1173
|
+
justify-content: center;
|
|
1174
|
+
width: 100%;
|
|
1175
|
+
min-width: 0;
|
|
1176
|
+
max-width: 100%;
|
|
1177
|
+
align-self: stretch;
|
|
1178
|
+
flex: 1 1 auto;
|
|
1179
|
+
min-height: var(--pm-card-height);
|
|
1180
|
+
height: auto;
|
|
1181
|
+
padding: 6px 8px;
|
|
1182
|
+
border: var(--pm-card-border-width) solid var(--pm-orange);
|
|
1183
|
+
border-radius: var(--pm-card-radius);
|
|
1184
|
+
background: #fff;
|
|
1185
|
+
color: var(--pm-purple);
|
|
1186
|
+
font: 500 1rem / 1.2 var(--exercise-font-family, inherit);
|
|
1187
|
+
letter-spacing: 0;
|
|
1188
|
+
text-align: center;
|
|
1189
|
+
word-break: normal;
|
|
1190
|
+
overflow-wrap: break-word;
|
|
1191
|
+
white-space: normal;
|
|
1192
|
+
hyphens: auto;
|
|
1193
|
+
overflow: visible;
|
|
1194
|
+
cursor: pointer;
|
|
1195
|
+
transition:
|
|
1196
|
+
background 0.35s ease,
|
|
1197
|
+
border-color 0.35s ease,
|
|
1198
|
+
transform 0.2s ease;
|
|
1136
1199
|
}
|
|
1137
1200
|
|
|
1138
|
-
.pair-matcher-card:not([aria-disabled=
|
|
1201
|
+
.pair-matcher-card:not([aria-disabled='true']):active {
|
|
1202
|
+
transform: scale(0.98);
|
|
1203
|
+
}
|
|
1139
1204
|
|
|
1140
|
-
.pair-matcher-card[aria-disabled=
|
|
1205
|
+
.pair-matcher-card[aria-disabled='true'] {
|
|
1206
|
+
cursor: default;
|
|
1207
|
+
}
|
|
1141
1208
|
|
|
1142
|
-
.pair-matcher-card--pending,
|
|
1209
|
+
.pair-matcher-card--pending,
|
|
1210
|
+
.pair-matcher-card--flash {
|
|
1211
|
+
border-color: var(--pm-selected-border);
|
|
1212
|
+
background: var(--pm-selected-bg);
|
|
1213
|
+
}
|
|
1143
1214
|
|
|
1144
|
-
.pair-matcher-card--correct
|
|
1215
|
+
.pair-matcher-card--correct {
|
|
1216
|
+
border-color: #43b925;
|
|
1217
|
+
background: #f2ffee;
|
|
1218
|
+
color: #43b925;
|
|
1219
|
+
}
|
|
1145
1220
|
|
|
1146
|
-
.pair-matcher-card--incorrect {
|
|
1221
|
+
.pair-matcher-card--incorrect {
|
|
1222
|
+
border-color: #d6234d;
|
|
1223
|
+
background: #fff0f7;
|
|
1224
|
+
color: #d6234d;
|
|
1225
|
+
}
|
|
1147
1226
|
|
|
1148
1227
|
.pair-matcher-dot {
|
|
1149
|
-
position: relative;
|
|
1150
|
-
|
|
1151
|
-
|
|
1228
|
+
position: relative;
|
|
1229
|
+
z-index: 3;
|
|
1230
|
+
flex-shrink: 0;
|
|
1231
|
+
width: var(--pm-dot-size);
|
|
1232
|
+
height: var(--pm-dot-size);
|
|
1233
|
+
border: var(--pm-dot-border-width) solid var(--pm-orange);
|
|
1234
|
+
border-radius: 50%;
|
|
1235
|
+
background: #fff;
|
|
1152
1236
|
}
|
|
1153
1237
|
|
|
1154
|
-
.pair-matcher-dot--south
|
|
1238
|
+
.pair-matcher-dot--south {
|
|
1239
|
+
margin-top: calc(var(--pm-dot-size) / -2);
|
|
1240
|
+
}
|
|
1155
1241
|
|
|
1156
|
-
.pair-matcher-dot--north
|
|
1242
|
+
.pair-matcher-dot--north {
|
|
1243
|
+
margin-bottom: calc(var(--pm-dot-size) / -2);
|
|
1244
|
+
}
|
|
1157
1245
|
|
|
1158
|
-
.pair-matcher-dot--active
|
|
1246
|
+
.pair-matcher-dot--active {
|
|
1247
|
+
background: var(--pm-orange);
|
|
1248
|
+
}
|
|
1159
1249
|
|
|
1160
|
-
.pair-matcher-dot--pending {
|
|
1250
|
+
.pair-matcher-dot--pending {
|
|
1251
|
+
border-color: var(--pm-selected-border);
|
|
1252
|
+
background: #fff;
|
|
1253
|
+
}
|
|
1161
1254
|
|
|
1162
|
-
.pair-matcher-dot--correct
|
|
1255
|
+
.pair-matcher-dot--correct {
|
|
1256
|
+
border-color: #43b925;
|
|
1257
|
+
background: #43b925;
|
|
1258
|
+
}
|
|
1163
1259
|
|
|
1164
|
-
.pair-matcher-dot--incorrect {
|
|
1260
|
+
.pair-matcher-dot--incorrect {
|
|
1261
|
+
border-color: #d6234d;
|
|
1262
|
+
background: #d6234d;
|
|
1263
|
+
}
|
|
1165
1264
|
|
|
1166
1265
|
.pair-matcher-lines {
|
|
1167
|
-
position: absolute;
|
|
1168
|
-
|
|
1266
|
+
position: absolute;
|
|
1267
|
+
inset: 0;
|
|
1268
|
+
z-index: 1;
|
|
1269
|
+
width: 100%;
|
|
1270
|
+
height: 100%;
|
|
1271
|
+
overflow: visible;
|
|
1272
|
+
pointer-events: none;
|
|
1169
1273
|
}
|
|
1170
1274
|
|
|
1171
|
-
.pair-matcher-line {
|
|
1275
|
+
.pair-matcher-line {
|
|
1276
|
+
stroke-dasharray: 1;
|
|
1277
|
+
animation: pair-matcher-line-draw 0.5s ease both;
|
|
1278
|
+
}
|
|
1172
1279
|
|
|
1173
|
-
@keyframes pair-matcher-line-draw {
|
|
1280
|
+
@keyframes pair-matcher-line-draw {
|
|
1281
|
+
from {
|
|
1282
|
+
stroke-dashoffset: 1;
|
|
1283
|
+
}
|
|
1284
|
+
to {
|
|
1285
|
+
stroke-dashoffset: 0;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1174
1288
|
|
|
1175
1289
|
.pair-matcher-card .text-item,
|
|
1176
1290
|
.pair-matcher-card .question-text,
|
|
1177
1291
|
.pair-matcher-card .group {
|
|
1178
|
-
margin: 0;
|
|
1179
|
-
|
|
1180
|
-
|
|
1292
|
+
margin: 0;
|
|
1293
|
+
min-width: 0;
|
|
1294
|
+
max-width: 100%;
|
|
1295
|
+
color: inherit;
|
|
1296
|
+
font: inherit;
|
|
1297
|
+
overflow-wrap: break-word;
|
|
1298
|
+
word-break: normal;
|
|
1299
|
+
white-space: normal;
|
|
1181
1300
|
}
|
|
1182
1301
|
|
|
1183
1302
|
.pair-matcher-card:not(.pair-matcher-card--rtl) .text-item,
|
|
1184
1303
|
.pair-matcher-card:not(.pair-matcher-card--rtl) .question-text,
|
|
1185
|
-
.pair-matcher-card:not(.pair-matcher-card--rtl) .group {
|
|
1304
|
+
.pair-matcher-card:not(.pair-matcher-card--rtl) .group {
|
|
1305
|
+
overflow-wrap: break-word;
|
|
1306
|
+
}
|
|
1186
1307
|
|
|
1187
|
-
.pair-matcher-card--rtl {
|
|
1308
|
+
.pair-matcher-card--rtl {
|
|
1309
|
+
direction: rtl;
|
|
1310
|
+
unicode-bidi: plaintext;
|
|
1311
|
+
}
|
|
1188
1312
|
|
|
1189
1313
|
.pair-matcher-card-content {
|
|
1190
|
-
display: block;
|
|
1314
|
+
display: block;
|
|
1315
|
+
width: 100%;
|
|
1316
|
+
min-width: 0;
|
|
1317
|
+
max-width: 100%;
|
|
1318
|
+
text-align: inherit;
|
|
1319
|
+
white-space: normal;
|
|
1191
1320
|
}
|
|
1192
1321
|
|
|
1193
|
-
.pair-matcher-card-content .space {
|
|
1322
|
+
.pair-matcher-card-content .space {
|
|
1323
|
+
display: inline;
|
|
1324
|
+
width: auto;
|
|
1325
|
+
}
|
|
1194
1326
|
|
|
1195
1327
|
.pair-matcher-card .text-item-arabic,
|
|
1196
1328
|
.pair-matcher-card .question-text-arabic {
|
|
1197
|
-
direction: rtl;
|
|
1198
|
-
|
|
1329
|
+
direction: rtl;
|
|
1330
|
+
font-size: 0.72rem;
|
|
1331
|
+
line-height: 1.15;
|
|
1332
|
+
overflow-wrap: normal;
|
|
1333
|
+
word-break: normal;
|
|
1334
|
+
hyphens: manual;
|
|
1199
1335
|
}
|
|
1200
1336
|
|
|
1201
1337
|
@media (max-width: 420px) {
|
|
1202
|
-
.pair-matcher-widget {
|
|
1203
|
-
|
|
1204
|
-
|
|
1338
|
+
.pair-matcher-widget {
|
|
1339
|
+
gap: 46px;
|
|
1340
|
+
}
|
|
1341
|
+
.pair-matcher-row {
|
|
1342
|
+
grid-template-columns: repeat(var(--pm-cols, 3), minmax(0, 1fr));
|
|
1343
|
+
gap: 12px;
|
|
1344
|
+
}
|
|
1345
|
+
.pair-matcher-card {
|
|
1346
|
+
min-height: 58px;
|
|
1347
|
+
padding: 6px 7px;
|
|
1348
|
+
font-size: 0.92rem;
|
|
1349
|
+
}
|
|
1205
1350
|
}
|
|
1206
1351
|
|
|
1207
1352
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mathscan/math-exercise-engine",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
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",
|