@mathscan/math-exercise-engine 1.0.13 → 1.0.14
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 +3254 -1220
- package/dist/index.js +6200 -150
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6200 -150
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +100 -0
- package/package.json +3 -1
package/dist/style.css
CHANGED
|
@@ -668,6 +668,106 @@ td.exercise-table-cell, th.exercise-table-cell {
|
|
|
668
668
|
display: inline-flex;
|
|
669
669
|
}
|
|
670
670
|
|
|
671
|
+
/* ========================================
|
|
672
|
+
MATCHER WIDGET
|
|
673
|
+
======================================== */
|
|
674
|
+
|
|
675
|
+
.matcher-widget {
|
|
676
|
+
display: flex;
|
|
677
|
+
flex-direction: column;
|
|
678
|
+
gap: 12px;
|
|
679
|
+
padding: 16px;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.matcher-row {
|
|
683
|
+
display: grid;
|
|
684
|
+
grid-template-columns: repeat(var(--matcher-cols, 3), 1fr);
|
|
685
|
+
gap: 12px;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.matcher-card {
|
|
689
|
+
display: flex;
|
|
690
|
+
flex-wrap: wrap;
|
|
691
|
+
align-items: center;
|
|
692
|
+
justify-content: center;
|
|
693
|
+
gap: 0 6px;
|
|
694
|
+
width: 100%;
|
|
695
|
+
min-height: 56px;
|
|
696
|
+
padding: 14px 12px;
|
|
697
|
+
border: 2.5px solid var(--exercise-border, #ddd);
|
|
698
|
+
border-radius: 14px;
|
|
699
|
+
background: var(--exercise-bg, #fff);
|
|
700
|
+
color: var(--exercise-text, #333);
|
|
701
|
+
font-size: var(--exercise-font-size, 1rem);
|
|
702
|
+
font-weight: var(--exercise-font-weight, 400);
|
|
703
|
+
line-height: 1.4;
|
|
704
|
+
text-align: center;
|
|
705
|
+
overflow-wrap: break-word;
|
|
706
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
|
|
707
|
+
cursor: pointer;
|
|
708
|
+
user-select: none;
|
|
709
|
+
transition: border-color 0.2s ease, background 0.2s ease,
|
|
710
|
+
color 0.2s ease, box-shadow 0.2s ease,
|
|
711
|
+
transform 0.2s ease, filter 0.2s ease;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.matcher-card:hover {
|
|
715
|
+
border-color: var(--exercise-accent, #705DC0);
|
|
716
|
+
box-shadow: 0 4px 10px rgba(112, 93, 192, 0.22);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.matcher-card:active {
|
|
720
|
+
transform: scale(0.96);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
.matcher-card--selected {
|
|
724
|
+
background: var(--matcher-card-color);
|
|
725
|
+
border-color: var(--matcher-card-color);
|
|
726
|
+
color: var(--matcher-card-text-color, #1a1a1a);
|
|
727
|
+
transform: translateY(-3px);
|
|
728
|
+
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/* Force all nested text descendants to inherit the button's color so
|
|
732
|
+
validation/assignment colors aren't masked by their own color rules. */
|
|
733
|
+
|
|
734
|
+
.matcher-card--selected * {
|
|
735
|
+
color: inherit;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.matcher-card--selected:hover {
|
|
739
|
+
border-color: var(--exercise-accent, #705DC0);
|
|
740
|
+
filter: brightness(1.07);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.matcher-card--selected:active {
|
|
744
|
+
transform: scale(0.96) translateY(0);
|
|
745
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
|
746
|
+
filter: none;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.matcher-widget.widget--correct .matcher-card--selected {
|
|
750
|
+
background: var(--exercise-correct, #22c55e);
|
|
751
|
+
border-color: var(--exercise-correct, #22c55e);
|
|
752
|
+
color: #fff;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.matcher-widget.widget--correct .matcher-card:not(.matcher-card--selected) {
|
|
756
|
+
border-color: var(--exercise-correct, #22c55e);
|
|
757
|
+
opacity: 0.5;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.matcher-widget.widget--incorrect .matcher-card--selected {
|
|
761
|
+
background: var(--exercise-incorrect, #ef4444);
|
|
762
|
+
border-color: var(--exercise-incorrect, #ef4444);
|
|
763
|
+
color: #fff;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.matcher-widget.widget--incorrect .matcher-card:not(.matcher-card--selected) {
|
|
767
|
+
border-color: var(--exercise-incorrect, #ef4444);
|
|
768
|
+
opacity: 0.5;
|
|
769
|
+
}
|
|
770
|
+
|
|
671
771
|
/**
|
|
672
772
|
* Number Line Styles
|
|
673
773
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mathscan/math-exercise-engine",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@dnd-kit/core": "^6.3.1",
|
|
49
49
|
"@dnd-kit/utilities": "^3.2.2",
|
|
50
50
|
"chevrotain": "^11.0.3",
|
|
51
|
+
"lodash": "^4.17.21",
|
|
51
52
|
"mathjs": "^12.4.0",
|
|
52
53
|
"zod": "^3.22.4"
|
|
53
54
|
},
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
"@testing-library/jest-dom": "^6.9.1",
|
|
68
69
|
"@testing-library/react": "^16.3.2",
|
|
69
70
|
"@testing-library/user-event": "^14.6.1",
|
|
71
|
+
"@types/lodash": "^4.17.24",
|
|
70
72
|
"@types/node": "^20.11.0",
|
|
71
73
|
"@types/react": "^19.0.0",
|
|
72
74
|
"@types/react-dom": "^19.0.0",
|