@teachinglab/omd 0.2.6 → 0.2.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/canvas/ui/toolbar.js +0 -15
- package/omd/config/omdConfigManager.js +2 -2
- package/omd/core/omdEquationStack.js +11 -2
- package/omd/display/omdDisplay.js +494 -80
- package/omd/nodes/omdEquationNode.js +46 -6
- package/omd/step-visualizer/omdStepVisualizer.js +387 -42
- package/omd/step-visualizer/omdStepVisualizerLayout.js +654 -11
- package/omd/step-visualizer/omdStepVisualizerTextBoxes.js +46 -8
- package/omd/utils/omdStepVisualizerInteractiveSteps.js +318 -121
- package/package.json +1 -1
- package/src/omdBalanceHanger.js +31 -1
- package/src/omdColor.js +1 -0
- package/src/omdCoordinatePlane.js +53 -3
- package/src/omdMetaExpression.js +8 -4
- package/src/omdTable.js +182 -52
package/canvas/ui/toolbar.js
CHANGED
|
@@ -60,21 +60,6 @@ export class Toolbar {
|
|
|
60
60
|
|
|
61
61
|
// Add to main SVG so it is rendered
|
|
62
62
|
this.canvas.svg.appendChild(this.toolbarGroup.svgObject);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// Check if the SVG is actually in the DOM
|
|
66
|
-
setTimeout(() => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// Check the actual SVG content
|
|
70
|
-
console.log('Toolbar SVG innerHTML:', this.toolbarGroup.svgObject.innerHTML);
|
|
71
|
-
console.log('Background SVG object:', this.background.svgObject);
|
|
72
|
-
console.log('Background SVG innerHTML:', this.background.svgObject.outerHTML);
|
|
73
|
-
|
|
74
|
-
// Check if the background is visible
|
|
75
|
-
console.log('Background fill color:', this.background.svgObject.getAttribute('fill'));
|
|
76
|
-
console.log('Background width/height:', this.background.svgObject.getAttribute('width'), this.background.svgObject.getAttribute('height'));
|
|
77
|
-
}, 100);
|
|
78
63
|
}
|
|
79
64
|
|
|
80
65
|
/**
|
|
@@ -34,7 +34,9 @@ export class omdEquationStack extends jsvgGroup {
|
|
|
34
34
|
|
|
35
35
|
// The sequence is the core. If a visualizer is needed, that's our sequence.
|
|
36
36
|
if (options.stepVisualizer) {
|
|
37
|
-
|
|
37
|
+
// Pass through step visualizer styling options
|
|
38
|
+
const stepVisualizerStyling = this.stylingOptions?.stepVisualizer || {};
|
|
39
|
+
this.sequence = new omdStepVisualizer(steps, stepVisualizerStyling);
|
|
38
40
|
} else {
|
|
39
41
|
this.sequence = new omdEquationSequenceNode(steps);
|
|
40
42
|
}
|
|
@@ -44,6 +46,13 @@ export class omdEquationStack extends jsvgGroup {
|
|
|
44
46
|
this.sequence.setDefaultEquationBackground(this.stylingOptions.equationBackground);
|
|
45
47
|
}
|
|
46
48
|
|
|
49
|
+
// Apply step visualizer background styling if provided
|
|
50
|
+
if (options.stepVisualizer && this.stylingOptions?.stepVisualizerBackground) {
|
|
51
|
+
if (typeof this.sequence.setBackgroundStyle === 'function') {
|
|
52
|
+
this.sequence.setBackgroundStyle(this.stylingOptions.stepVisualizerBackground);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
47
56
|
// If a toolbar is needed, create it.
|
|
48
57
|
if (this.toolbarOptions?.enabled) {
|
|
49
58
|
// Default undo: call global hook if provided
|
|
@@ -508,7 +517,7 @@ export class omdEquationStack extends jsvgGroup {
|
|
|
508
517
|
}
|
|
509
518
|
if (seq.layoutManager) {
|
|
510
519
|
try {
|
|
511
|
-
seq.layoutManager.updateVisualLayout();
|
|
520
|
+
seq.layoutManager.updateVisualLayout(true); // Allow repositioning for equation stack changes
|
|
512
521
|
seq.layoutManager.updateVisualVisibility();
|
|
513
522
|
seq.layoutManager.updateAllLinePositions();
|
|
514
523
|
} catch (_) {}
|