@teachinglab/omd 0.7.24 → 0.7.26

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.
@@ -202,6 +202,11 @@ export class omdCanvas {
202
202
  this.focusFrameManager = new FocusFrameManager(this);
203
203
  }
204
204
 
205
+ // Keep the custom cursor above toolbar/buttons and all other SVG UI.
206
+ if (this.cursor && this.svg) {
207
+ this.cursor.attachTo(this.svg);
208
+ }
209
+
205
210
  // Apply any selection styles defined in config to the ResizeHandleManager
206
211
  // (PointerTool registers the manager on canvas.resizeHandleManager during its constructor)
207
212
  if (this.resizeHandleManager && this.config.selection) {
@@ -196,12 +196,13 @@ export class Cursor {
196
196
  const group = document.createElementNS('http://www.w3.org/2000/svg', 'g');
197
197
  group.setAttribute('data-shape', 'pointer');
198
198
 
199
- // Standard arrow pointer cursor
199
+ // Use the same pointer cursor as the toolbar icon
200
200
  const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
201
- path.setAttribute('d', 'M 2,2 L 2,16 L 7,11 L 10,18 L 12,17 L 9,10 L 16,10 Z');
201
+ path.setAttribute('d', 'M1.63448 2.04462C1.60922 1.98633 1.60208 1.92179 1.61397 1.85938C1.62585 1.79697 1.65623 1.73958 1.70116 1.69466C1.74608 1.64973 1.80347 1.61935 1.86588 1.60747C1.92829 1.59558 1.99283 1.60272 2.05112 1.62798L12.2911 5.78798C12.3534 5.81335 12.4061 5.85768 12.4417 5.91469C12.4774 5.9717 12.4941 6.03849 12.4897 6.10557C12.4852 6.17266 12.4597 6.23663 12.4169 6.28842C12.374 6.3402 12.3159 6.37717 12.2508 6.39406L8.33144 7.40526C8.11 7.46219 7.90784 7.5774 7.74599 7.73891C7.58415 7.90042 7.46852 8.10234 7.41112 8.32366L6.40056 12.2443C6.38367 12.3094 6.3467 12.3675 6.29492 12.4104C6.24313 12.4532 6.17916 12.4787 6.11207 12.4832C6.04499 12.4876 5.9782 12.4709 5.92119 12.4352C5.86419 12.3996 5.81985 12.3469 5.79448 12.2846L1.63448 2.04462Z');
202
202
  path.setAttribute('fill', 'white');
203
203
  path.setAttribute('stroke', '#000000');
204
- path.setAttribute('stroke-width', '1.2');
204
+ path.setAttribute('stroke-width', '1.28');
205
+ path.setAttribute('stroke-linecap', 'round');
205
206
  path.setAttribute('stroke-linejoin', 'round');
206
207
 
207
208
  group.appendChild(path);
@@ -460,4 +461,13 @@ export class Cursor {
460
461
  this.element.parentNode.removeChild(this.element);
461
462
  }
462
463
  }
464
+
465
+ /**
466
+ * Reattach the cursor element to a specific parent so it can sit above other SVG UI.
467
+ * @param {SVGElement} parent
468
+ */
469
+ attachTo(parent) {
470
+ if (!parent || !this.element) return;
471
+ parent.appendChild(this.element);
472
+ }
463
473
  }
@@ -28,6 +28,11 @@ export class Toolbar {
28
28
  this._updateActiveButton(event.detail.name);
29
29
  });
30
30
 
31
+ // Listen for canvas resize events to reposition toolbar
32
+ this.canvas.on('resized', () => {
33
+ this._updatePosition();
34
+ });
35
+
31
36
 
32
37
  }
33
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teachinglab/omd",
3
- "version": "0.7.24",
3
+ "version": "0.7.26",
4
4
  "description": "omd",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",