@mathscan/math-exercise-engine 1.0.0 → 1.0.1
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 +215 -1
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@import './dnd/dnd.css';
|
|
2
1
|
/* ========================================
|
|
3
2
|
MATH EXERCISE ENGINE - DEFAULT STYLES
|
|
4
3
|
========================================
|
|
@@ -344,3 +343,218 @@ button.drag-option {
|
|
|
344
343
|
}
|
|
345
344
|
}
|
|
346
345
|
|
|
346
|
+
/* ============================================
|
|
347
|
+
DND STYLES
|
|
348
|
+
============================================ */
|
|
349
|
+
|
|
350
|
+
/* Draggable base */
|
|
351
|
+
.draggable {
|
|
352
|
+
display: inline-block;
|
|
353
|
+
user-select: none;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.draggable.dragging {
|
|
357
|
+
opacity: 0.5;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* Droppable base */
|
|
361
|
+
.droppable {
|
|
362
|
+
display: inline-block;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.droppable.drop-active {
|
|
366
|
+
outline: 2px dashed #4a90d9;
|
|
367
|
+
outline-offset: 2px;
|
|
368
|
+
background-color: rgba(74, 144, 217, 0.1);
|
|
369
|
+
border-radius: 4px;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.droppable.drop-invalid {
|
|
373
|
+
outline: 2px dashed #e74c3c;
|
|
374
|
+
outline-offset: 2px;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* Drag overlay - the item following cursor */
|
|
378
|
+
.drag-overlay-option {
|
|
379
|
+
padding: 8px 16px;
|
|
380
|
+
background: #4a90d9;
|
|
381
|
+
color: white;
|
|
382
|
+
border-radius: 6px;
|
|
383
|
+
font-weight: 500;
|
|
384
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
385
|
+
cursor: grabbing;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/* Drag options container */
|
|
389
|
+
.drag-options {
|
|
390
|
+
display: flex;
|
|
391
|
+
flex-wrap: wrap;
|
|
392
|
+
gap: 8px;
|
|
393
|
+
/* padding: 12px; */
|
|
394
|
+
/* background: #f5f5f5; */
|
|
395
|
+
border-radius: 8px;
|
|
396
|
+
justify-content: center;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.drag-option-wrapper {
|
|
400
|
+
display: inline-block;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.drag-option {
|
|
404
|
+
padding: 10px 20px;
|
|
405
|
+
border: 2px solid #ddd;
|
|
406
|
+
border-radius: 8px;
|
|
407
|
+
background: white;
|
|
408
|
+
font-size: 16px;
|
|
409
|
+
font-weight: 500;
|
|
410
|
+
cursor: grab;
|
|
411
|
+
transition: all 0.15s ease;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.drag-option:hover {
|
|
415
|
+
border-color: #4a90d9;
|
|
416
|
+
background: #f0f7ff;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.drag-option.selected {
|
|
420
|
+
border-color: #4a90d9;
|
|
421
|
+
background: #e3f0ff;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/* Slot container - maintains space when item is dragged out */
|
|
425
|
+
.drag-option-slot {
|
|
426
|
+
display: inline-flex;
|
|
427
|
+
min-width: 60px;
|
|
428
|
+
min-height: 44px;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/* Empty slot - shows where item came from */
|
|
432
|
+
.drag-option-empty {
|
|
433
|
+
min-width: 60px;
|
|
434
|
+
min-height: 44px;
|
|
435
|
+
border: 2px dashed #d4c5a9;
|
|
436
|
+
border-radius: 8px;
|
|
437
|
+
background: rgba(212, 197, 169, 0.2);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/* Inline input droppable */
|
|
441
|
+
.inline-input-droppable {
|
|
442
|
+
display: inline-flex;
|
|
443
|
+
align-items: center;
|
|
444
|
+
justify-content: center;
|
|
445
|
+
border-radius: 4px;
|
|
446
|
+
min-width: 50px;
|
|
447
|
+
min-height: 40px;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.inline-input {
|
|
451
|
+
padding: 4px 8px;
|
|
452
|
+
border: 2px dashed #b8a88a;
|
|
453
|
+
border-radius: 8px;
|
|
454
|
+
font-size: inherit;
|
|
455
|
+
text-align: center;
|
|
456
|
+
background: rgba(212, 197, 169, 0.15);
|
|
457
|
+
transition: border-color 0.15s ease;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.inline-input:focus {
|
|
461
|
+
outline: none;
|
|
462
|
+
border-color: #4a90d9;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/* Chip style for dropped values - matches drag-option button */
|
|
466
|
+
.inline-input-chip {
|
|
467
|
+
padding: 10px 20px;
|
|
468
|
+
border: 2px solid #9b8fc7;
|
|
469
|
+
border-radius: 8px;
|
|
470
|
+
background: #e8e4f3;
|
|
471
|
+
font-size: 16px;
|
|
472
|
+
font-weight: 500;
|
|
473
|
+
color: #5c5470;
|
|
474
|
+
cursor: pointer;
|
|
475
|
+
transition: all 0.15s ease;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.inline-input-chip:hover {
|
|
479
|
+
background: #ddd8eb;
|
|
480
|
+
border-color: #8578b0;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/* When droppable is active, style the input inside */
|
|
484
|
+
.inline-input-droppable.drop-active .inline-input {
|
|
485
|
+
border-color: #4a90d9;
|
|
486
|
+
background-color: rgba(74, 144, 217, 0.05);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/* Drag options container at bottom */
|
|
490
|
+
.drag-options-container {
|
|
491
|
+
/* margin-top: 20px;
|
|
492
|
+
padding-top: 16px;
|
|
493
|
+
border-top: 1px solid #eee; */
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/* ============================================
|
|
497
|
+
FUTURE WIDGETS - Placeholder styles
|
|
498
|
+
============================================ */
|
|
499
|
+
|
|
500
|
+
/* ============================================
|
|
501
|
+
DRAGGABLE TOOLS (Ruler, Protractor, etc.)
|
|
502
|
+
============================================ */
|
|
503
|
+
|
|
504
|
+
.tools-overlay {
|
|
505
|
+
position: absolute;
|
|
506
|
+
top: 0;
|
|
507
|
+
left: 0;
|
|
508
|
+
width: 100%;
|
|
509
|
+
height: 100%;
|
|
510
|
+
pointer-events: none;
|
|
511
|
+
z-index: 50;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.draggable-tool {
|
|
515
|
+
pointer-events: auto;
|
|
516
|
+
transition: box-shadow 0.15s ease;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.draggable-tool:hover {
|
|
520
|
+
filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.draggable-tool.dragging {
|
|
524
|
+
filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/* Rotate handle */
|
|
528
|
+
.tool-rotate-handle {
|
|
529
|
+
position: absolute;
|
|
530
|
+
top: -30px;
|
|
531
|
+
left: 50%;
|
|
532
|
+
transform: translateX(-50%);
|
|
533
|
+
width: 24px;
|
|
534
|
+
height: 24px;
|
|
535
|
+
background: #e8e4f3;
|
|
536
|
+
border: 2px solid #9b8fc7;
|
|
537
|
+
border-radius: 50%;
|
|
538
|
+
display: flex;
|
|
539
|
+
align-items: center;
|
|
540
|
+
justify-content: center;
|
|
541
|
+
cursor: grab;
|
|
542
|
+
font-size: 14px;
|
|
543
|
+
color: #5c5470;
|
|
544
|
+
opacity: 0;
|
|
545
|
+
transition: opacity 0.15s ease;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.draggable-tool:hover .tool-rotate-handle {
|
|
549
|
+
opacity: 1;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.tool-rotate-handle:hover {
|
|
553
|
+
background: #e8e4f3;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/* Ensure exercise container has relative positioning for tools */
|
|
557
|
+
.math-exercise-renderer {
|
|
558
|
+
position: relative;
|
|
559
|
+
min-height: 200px;
|
|
560
|
+
}
|
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.1",
|
|
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",
|