@mathscan/math-exercise-engine 1.1.1 → 1.1.2
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 +6581 -2558
- package/dist/index.js +874 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +874 -78
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +103 -0
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -951,6 +951,109 @@ th.exercise-table-cell {
|
|
|
951
951
|
opacity: 0.5;
|
|
952
952
|
} */
|
|
953
953
|
|
|
954
|
+
/* ========================================
|
|
955
|
+
PAIR MATCHER WIDGET
|
|
956
|
+
======================================== */
|
|
957
|
+
|
|
958
|
+
.pair-matcher-widget {
|
|
959
|
+
--pm-orange: #FFCA76; --pm-purple: #705DC0;
|
|
960
|
+
--pm-selected-bg: #E7E2FF; --pm-selected-border: #AE9CFF;
|
|
961
|
+
--pm-card-width: 163px; --pm-card-height: 82px; --pm-card-radius: 12px; --pm-card-border-width: 1px;
|
|
962
|
+
--pm-dot-size: 17px; --pm-dot-border-width: 2px;
|
|
963
|
+
--pm-line-color: var(--pm-orange); --pm-line-color-correct: #43B925; --pm-line-color-incorrect: #D6234D; --pm-line-width: 4px;
|
|
964
|
+
position: relative; display: flex; flex-direction: column;
|
|
965
|
+
gap: 52px; width: max-content; max-width: 100%; margin-inline: auto; padding: 0;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.pair-matcher-row {
|
|
969
|
+
position: relative; z-index: 2; display: grid;
|
|
970
|
+
grid-template-columns: repeat(var(--pm-cols, 3), minmax(0, var(--pm-card-width)));
|
|
971
|
+
justify-content: center; gap: 18px; align-items: stretch; min-width: 0;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
.pair-matcher-cell { display: flex; flex-direction: column; align-items: center; min-width: 0; }
|
|
975
|
+
|
|
976
|
+
.pair-matcher-card {
|
|
977
|
+
box-sizing: border-box; display: flex; align-items: center; justify-content: center;
|
|
978
|
+
width: 100%; min-width: 0; max-width: 100%; align-self: stretch; flex: 1 1 auto;
|
|
979
|
+
min-height: var(--pm-card-height); height: auto; padding: 6px 8px;
|
|
980
|
+
border: var(--pm-card-border-width) solid var(--pm-orange); border-radius: var(--pm-card-radius);
|
|
981
|
+
background: #fff; color: var(--pm-purple);
|
|
982
|
+
font: 500 1rem / 1.2 var(--exercise-font-family, inherit); letter-spacing: 0;
|
|
983
|
+
text-align: center; word-break: normal; overflow-wrap: break-word;
|
|
984
|
+
white-space: normal; hyphens: auto; overflow: visible; cursor: pointer;
|
|
985
|
+
transition: background 0.35s ease, border-color 0.35s ease, transform 0.2s ease;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
.pair-matcher-card:not([aria-disabled="true"]):active { transform: scale(0.98); }
|
|
989
|
+
|
|
990
|
+
.pair-matcher-card[aria-disabled="true"] { cursor: default; }
|
|
991
|
+
|
|
992
|
+
.pair-matcher-card--pending, .pair-matcher-card--flash { border-color: var(--pm-selected-border); background: var(--pm-selected-bg); }
|
|
993
|
+
|
|
994
|
+
.pair-matcher-card--correct { border-color: #43B925; background: #F2FFEE; color: #43B925; }
|
|
995
|
+
|
|
996
|
+
.pair-matcher-card--incorrect { border-color: #D6234D; background: #FFF0F7; color: #D6234D; }
|
|
997
|
+
|
|
998
|
+
.pair-matcher-dot {
|
|
999
|
+
position: relative; z-index: 3; flex-shrink: 0;
|
|
1000
|
+
width: var(--pm-dot-size); height: var(--pm-dot-size);
|
|
1001
|
+
border: var(--pm-dot-border-width) solid var(--pm-orange); border-radius: 50%; background: #fff;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.pair-matcher-dot--south { margin-top: calc(var(--pm-dot-size) / -2); }
|
|
1005
|
+
|
|
1006
|
+
.pair-matcher-dot--north { margin-bottom: calc(var(--pm-dot-size) / -2); }
|
|
1007
|
+
|
|
1008
|
+
.pair-matcher-dot--active { background: var(--pm-orange); }
|
|
1009
|
+
|
|
1010
|
+
.pair-matcher-dot--pending { border-color: var(--pm-selected-border); background: #fff; }
|
|
1011
|
+
|
|
1012
|
+
.pair-matcher-dot--correct { border-color: #43B925; background: #43B925; }
|
|
1013
|
+
|
|
1014
|
+
.pair-matcher-dot--incorrect { border-color: #D6234D; background: #D6234D; }
|
|
1015
|
+
|
|
1016
|
+
.pair-matcher-lines {
|
|
1017
|
+
position: absolute; inset: 0; z-index: 1;
|
|
1018
|
+
width: 100%; height: 100%; overflow: visible; pointer-events: none;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.pair-matcher-line { stroke-dasharray: 1; animation: pair-matcher-line-draw 0.5s ease both; }
|
|
1022
|
+
|
|
1023
|
+
@keyframes pair-matcher-line-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
|
|
1024
|
+
|
|
1025
|
+
.pair-matcher-card .text-item,
|
|
1026
|
+
.pair-matcher-card .question-text,
|
|
1027
|
+
.pair-matcher-card .group {
|
|
1028
|
+
margin: 0; min-width: 0; max-width: 100%;
|
|
1029
|
+
color: inherit; font: inherit;
|
|
1030
|
+
overflow-wrap: break-word; word-break: normal; white-space: normal;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
.pair-matcher-card:not(.pair-matcher-card--rtl) .text-item,
|
|
1034
|
+
.pair-matcher-card:not(.pair-matcher-card--rtl) .question-text,
|
|
1035
|
+
.pair-matcher-card:not(.pair-matcher-card--rtl) .group { overflow-wrap: break-word; }
|
|
1036
|
+
|
|
1037
|
+
.pair-matcher-card--rtl { direction: rtl; unicode-bidi: plaintext; }
|
|
1038
|
+
|
|
1039
|
+
.pair-matcher-card-content {
|
|
1040
|
+
display: block; width: 100%; min-width: 0; max-width: 100%; text-align: inherit; white-space: normal;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
.pair-matcher-card-content .space { display: inline; width: auto; }
|
|
1044
|
+
|
|
1045
|
+
.pair-matcher-card .text-item-arabic,
|
|
1046
|
+
.pair-matcher-card .question-text-arabic {
|
|
1047
|
+
direction: rtl; font-size: 0.72rem; line-height: 1.15;
|
|
1048
|
+
overflow-wrap: normal; word-break: normal; hyphens: manual;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
@media (max-width: 420px) {
|
|
1052
|
+
.pair-matcher-widget { gap: 46px; }
|
|
1053
|
+
.pair-matcher-row { grid-template-columns: repeat(var(--pm-cols, 3), minmax(0, 1fr)); gap: 12px; }
|
|
1054
|
+
.pair-matcher-card { min-height: 58px; padding: 6px 7px; font-size: 0.92rem; }
|
|
1055
|
+
}
|
|
1056
|
+
|
|
954
1057
|
/**
|
|
955
1058
|
* Number Line Styles
|
|
956
1059
|
*
|
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.2",
|
|
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",
|