@teachinglab/omd 0.7.2 → 0.7.3

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.
@@ -198,13 +198,13 @@ export class Toolbar {
198
198
  _updateActiveButton(toolName) {
199
199
  // Reset all buttons
200
200
  this.buttons.forEach(button => {
201
- button.setFillColor('white');
201
+ button.setFillColor(this.omdColor.lightGray);
202
202
  });
203
203
 
204
204
  // Highlight active button
205
205
  const activeButton = this.buttons.get(toolName);
206
206
  if (activeButton) {
207
- activeButton.setFillColor(this.omdColor.lightGray);
207
+ activeButton.setFillColor('white');
208
208
  this.activeButton = activeButton;
209
209
  } else {
210
210
  this.activeButton = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teachinglab/omd",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "omd",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
@@ -35,6 +35,14 @@ export class omdExpression extends omdMetaExpression
35
35
  const parsed = parseExpressionString(data);
36
36
  if ( parsed ) data = parsed;
37
37
  }
38
+ // Handle object with 'expression' string property
39
+ else if ( typeof data === 'object' && data.expression && typeof data.expression === 'string' ) {
40
+ const parsed = parseExpressionString(data.expression);
41
+ if ( parsed ) {
42
+ // Merge parsed data into data object
43
+ data = { ...data, ...parsed };
44
+ }
45
+ }
38
46
 
39
47
  if ( typeof data.termsAndOpers != "undefined" )
40
48
  {
@@ -73,6 +81,14 @@ export class omdExpression extends omdMetaExpression
73
81
  this.operatorSet.push( P );
74
82
  this.expressionStack.addChild( P );
75
83
  }
84
+ else if ( elem.omdType == "string" )
85
+ {
86
+ // Fallback for string tokens - treat as term with variable name
87
+ var T = new omdTerm(1, elem.name, 1);
88
+ T.hideBackgroundByDefault();
89
+ this.termSet.push( T );
90
+ this.expressionStack.addChild( T );
91
+ }
76
92
  }
77
93
  }
78
94
 
@@ -108,9 +124,10 @@ export class omdExpression extends omdMetaExpression
108
124
 
109
125
  this.setWidthAndHeight( this.backRect.width, this.backRect.height );
110
126
 
111
- // Set individual width/height properties and viewBox for API compatibility
127
+ // Set individual width/height properties
112
128
  this.width = this.backRect.width;
113
129
  this.height = this.backRect.height;
114
- this.svgObject.setAttribute('viewBox', `0 0 ${this.width} ${this.height}`);
130
+ // Removed viewBox setting as it is not valid for 'g' elements and can cause rendering issues
131
+ // this.svgObject.setAttribute('viewBox', `0 0 ${this.width} ${this.height}`);
115
132
  }
116
133
  }