@teachinglab/omd 0.7.22 → 0.7.23

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.
@@ -117,6 +117,8 @@ export class omdCanvas {
117
117
  this.svg.setAttribute('viewBox', `0 0 ${this.config.width} ${this.config.height}`);
118
118
  this.svg.style.cssText = `
119
119
  display: block;
120
+ width: 100%;
121
+ height: 100%;
120
122
  background: ${this.config.backgroundColor};
121
123
  cursor: none;
122
124
  touch-action: none;
@@ -441,11 +443,16 @@ export class omdCanvas {
441
443
  }
442
444
 
443
445
  /**
444
- * Handle window resize
446
+ * Handle window resize — resize the canvas to match the container.
445
447
  * @private
446
448
  */
447
449
  _handleResize() {
448
- // Optional: implement responsive behavior
450
+ if (!this.container) return;
451
+ const w = Math.max(400, this.container.clientWidth || this.container.getBoundingClientRect().width || 0);
452
+ const h = Math.max(400, this.container.clientHeight || this.container.getBoundingClientRect().height || 0);
453
+ if (!w || !h) return;
454
+ if (Math.abs(w - this.config.width) < 1 && Math.abs(h - this.config.height) < 1) return;
455
+ this.resize(w, h);
449
456
  }
450
457
 
451
458
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teachinglab/omd",
3
- "version": "0.7.22",
3
+ "version": "0.7.23",
4
4
  "description": "omd",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",