@mathscan/math-exercise-engine 1.1.16 → 1.1.17

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
@@ -2418,6 +2418,101 @@ th.exercise-table-cell.exercise-table-cell--last-row:last-child {
2418
2418
  background: #fef2f2;
2419
2419
  }
2420
2420
 
2421
+ .grid-symmetry {
2422
+ /* Figma palette. All tokens remain overridable by consuming applications. */
2423
+ --grid-symmetry-cell-color: #fff;
2424
+ --grid-symmetry-focus-color: #0f172a;
2425
+ --grid-symmetry-reference-color: #705dc0;
2426
+ --grid-symmetry-prefilled-color: #4f86d9;
2427
+ --grid-symmetry-answer-color: #291a64;
2428
+ --grid-symmetry-correct-color: #43b925;
2429
+ --grid-symmetry-incorrect-color: #d6234d;
2430
+ --grid-symmetry-line-color: #ffca76;
2431
+ --grid-symmetry-axis-color: #291a64;
2432
+ max-width: 100%;
2433
+ overflow: auto;
2434
+ padding: 0.75rem;
2435
+ }
2436
+
2437
+ .grid-symmetry__grid {
2438
+ display: grid;
2439
+ position: relative;
2440
+ width: max-content;
2441
+ gap: 1px;
2442
+ padding: 1px;
2443
+ background: var(--grid-symmetry-line-color);
2444
+ }
2445
+
2446
+ .grid-symmetry__cell {
2447
+ box-sizing: border-box;
2448
+ width: var(--grid-symmetry-cell-size);
2449
+ height: var(--grid-symmetry-cell-size);
2450
+ min-width: 0;
2451
+ padding: 0;
2452
+ border: 0;
2453
+ border-radius: 0;
2454
+ background: var(--grid-symmetry-cell-color);
2455
+ appearance: none;
2456
+ opacity: 1;
2457
+ transition: background-color 120ms ease;
2458
+ }
2459
+
2460
+ /* Unlocked cells only — locked ones render as plain spans and are not clickable. */
2461
+
2462
+ .grid-symmetry__cell--editable {
2463
+ cursor: pointer;
2464
+ }
2465
+
2466
+ .grid-symmetry__cell--editable:focus-visible {
2467
+ outline: 3px solid var(--grid-symmetry-focus-color);
2468
+ outline-offset: -3px;
2469
+ position: relative;
2470
+ z-index: 2;
2471
+ }
2472
+
2473
+ .grid-symmetry__cell--reference {
2474
+ background: var(--grid-symmetry-reference-color);
2475
+ }
2476
+
2477
+ .grid-symmetry__cell--prefilled {
2478
+ background: var(--grid-symmetry-prefilled-color);
2479
+ }
2480
+
2481
+ .grid-symmetry__cell--answer {
2482
+ background: var(--grid-symmetry-answer-color);
2483
+ }
2484
+
2485
+ .grid-symmetry--correct .grid-symmetry__cell--interactive.grid-symmetry__cell--selected {
2486
+ background: var(--grid-symmetry-correct-color);
2487
+ }
2488
+
2489
+ .grid-symmetry--incorrect .grid-symmetry__cell--interactive.grid-symmetry__cell--selected {
2490
+ background: var(--grid-symmetry-incorrect-color);
2491
+ }
2492
+
2493
+ .grid-symmetry__axis {
2494
+ position: absolute;
2495
+ z-index: 3;
2496
+ pointer-events: none;
2497
+ background: var(--grid-symmetry-axis-color);
2498
+ }
2499
+
2500
+ .grid-symmetry__axis--vertical {
2501
+ top: -12px;
2502
+ bottom: -12px;
2503
+ left: 50%;
2504
+ width: 3px;
2505
+ transform: translateX(-50%);
2506
+ }
2507
+
2508
+ .grid-symmetry__axis--horizontal {
2509
+ right: -12px;
2510
+ left: -12px;
2511
+ top: 50%;
2512
+ height: 3px;
2513
+ transform: translateY(-50%);
2514
+ }
2515
+
2421
2516
  /**
2422
2517
  * Button & Action Styles
2423
2518
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathscan/math-exercise-engine",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
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",
@@ -19,6 +19,7 @@
19
19
  "scripts": {
20
20
  "build": "vite build",
21
21
  "dev": "vite build --watch",
22
+ "playground": "vite --open /playground/grid-symmetry-builder/",
22
23
  "demo": "node examples/demo.mjs",
23
24
  "demo:ts": "tsx --conditions=import examples/demo.ts",
24
25
  "demo:build": "pnpm run build && node examples/demo.mjs",