@mathscan/math-exercise-engine 1.1.6 → 1.1.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
@@ -142,7 +142,9 @@
142
142
  ======================================== */
143
143
 
144
144
  .exercise-layout-container {
145
- /* Default: regular block layout */
145
+ /* Default: regular block layout.
146
+ position:relative makes this the anchor for the absolute tools-overlay. */
147
+ position: relative;
146
148
  }
147
149
 
148
150
  .exercise-layout-container.has-keypad {
@@ -2083,6 +2085,11 @@ th.exercise-table-cell {
2083
2085
  border-color: #8578b0;
2084
2086
  }
2085
2087
 
2088
+ /* Original chip dims while its copy is shown in the drag overlay */
2089
+ .inline-input-chip.dragging {
2090
+ opacity: 0.4;
2091
+ }
2092
+
2086
2093
  /* When droppable is active, style the input inside */
2087
2094
  .inline-input-droppable.drop-active .inline-input {
2088
2095
  border-color: #4a90d9;
@@ -2093,6 +2100,7 @@ th.exercise-table-cell {
2093
2100
  DRAGGABLE TOOLS (Ruler, Protractor, etc.)
2094
2101
  ============================================ */
2095
2102
 
2103
+ /* Default overlay — absolute positioning (for floating-over-exercise future use) */
2096
2104
  .tools-overlay {
2097
2105
  position: absolute;
2098
2106
  top: 0;
@@ -2101,11 +2109,13 @@ th.exercise-table-cell {
2101
2109
  height: 100%;
2102
2110
  pointer-events: none;
2103
2111
  z-index: 50;
2112
+ overflow: visible;
2104
2113
  }
2105
2114
 
2106
2115
  .draggable-tool {
2107
2116
  pointer-events: auto;
2108
- transition: box-shadow 0.15s ease;
2117
+ touch-action: none;
2118
+ border-radius: 3px;
2109
2119
  }
2110
2120
 
2111
2121
  .draggable-tool:hover {
@@ -2116,37 +2126,58 @@ th.exercise-table-cell {
2116
2126
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
2117
2127
  }
2118
2128
 
2119
- /* Rotate handle */
2120
- .tool-rotate-handle {
2129
+ /* Ensure exercise container allows tools to float outside */
2130
+ .math-exercise-renderer {
2131
+ position: relative;
2132
+ overflow: visible;
2133
+ }
2134
+
2135
+ /* ── Intro jiggle — plays on mount so students know tools are draggable ─────── */
2136
+ @keyframes tool-jiggle {
2137
+ 0%, 100% { transform: translateX(0) rotate(0deg); }
2138
+ 20% { transform: translateX(-5px) rotate(-2deg); }
2139
+ 40% { transform: translateX(5px) rotate(2deg); }
2140
+ 60% { transform: translateX(-3px) rotate(-1deg); }
2141
+ 80% { transform: translateX(3px) rotate(1deg); }
2142
+ }
2143
+
2144
+ .tool-content-jiggle {
2145
+ animation: tool-jiggle 0.55s ease-in-out 0.4s 2 both;
2146
+ }
2147
+
2148
+ /* ── Flip button (set-square mirror) ─────────────────────────────────────────── */
2149
+ .tool-flip-btn {
2121
2150
  position: absolute;
2122
- top: -30px;
2151
+ bottom: -36px;
2123
2152
  left: 50%;
2124
2153
  transform: translateX(-50%);
2125
- width: 24px;
2126
- height: 24px;
2127
- background: #e8e4f3;
2128
- border: 2px solid #9b8fc7;
2154
+ width: 30px;
2155
+ height: 30px;
2156
+ border: 1.5px solid #705DC0;
2129
2157
  border-radius: 50%;
2158
+ background: #fff;
2159
+ color: #705DC0;
2160
+ cursor: pointer;
2130
2161
  display: flex;
2131
2162
  align-items: center;
2132
2163
  justify-content: center;
2133
- cursor: grab;
2134
- font-size: 14px;
2135
- color: #5c5470;
2136
- opacity: 0;
2137
- transition: opacity 0.15s ease;
2164
+ pointer-events: auto;
2165
+ z-index: 102;
2166
+ opacity: 0.78;
2167
+ transition: opacity 0.15s, background 0.15s, color 0.15s;
2168
+ padding: 0;
2169
+ box-shadow: 0 1px 5px rgba(112, 93, 192, 0.22);
2138
2170
  }
2139
2171
 
2140
- .draggable-tool:hover .tool-rotate-handle {
2172
+ .tool-flip-btn:hover {
2141
2173
  opacity: 1;
2174
+ background: #705DC0;
2175
+ color: #fff;
2142
2176
  }
2143
2177
 
2144
- .tool-rotate-handle:hover {
2145
- background: #e8e4f3;
2146
- }
2147
-
2148
- /* Ensure exercise container has relative positioning for tools */
2149
- .math-exercise-renderer {
2150
- position: relative;
2151
- min-height: 200px;
2178
+ .tool-flip-btn--active {
2179
+ background: #705DC0;
2180
+ color: #fff;
2181
+ opacity: 1;
2182
+ box-shadow: 0 1px 5px rgba(112, 93, 192, 0.4);
2152
2183
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathscan/math-exercise-engine",
3
- "version": "1.1.6",
3
+ "version": "1.1.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",