@leapfrog/interactive-canvas 2.0.20-beta-1 → 2.0.20-beta-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.
@@ -2476,7 +2476,7 @@ class Text extends AbstractCanvasObject {
2476
2476
  text: `${lineNumber}.`
2477
2477
  });
2478
2478
  }
2479
- if (method === "fillText" && this.fabricObject.left <= 0) {
2479
+ if (method === "fillText" && this.fabricObject.left <= 3) {
2480
2480
  left = left + this.getOrderedListMargin();
2481
2481
  }
2482
2482
  this.fabricObject.dirty = true;
@@ -3358,6 +3358,8 @@ class AbstractInteractiveCanvas {
3358
3358
  }
3359
3359
  setMultiSelect(value) {
3360
3360
  this.fabricCanvas.selection = value;
3361
+ this.fabricCanvas.selectionColor = value ? "rgba(0,0,0,0.1)" : "transparent"; // Adjust selection color
3362
+ this.fabricCanvas.selectionBorderColor = "transparent";
3361
3363
  this.fabricCanvas.selectionKey = value ? "shiftKey" : null;
3362
3364
  }
3363
3365
  /**
@@ -3599,7 +3601,12 @@ class AbstractInteractiveCanvas {
3599
3601
  }
3600
3602
  findObject(id) {
3601
3603
  //Don't use strict compare here. fabric ids are numbers while ad builder ids are strings... mostly.
3602
- return _.find(this.objects$.value, (object) => object.getId() == id);
3604
+ //return _.find(this.objects$.value, (object: AbstractCanvasObject<any>) => object.getId() == id)!;
3605
+ const foundObject = _.find(this.objects$.value, (object) => object.getId() == id);
3606
+ if (!foundObject) {
3607
+ throw new Error(`Object with id [${id}] not found`);
3608
+ }
3609
+ return foundObject;
3603
3610
  }
3604
3611
  /**
3605
3612
  * Reset zoom and canvas dimensions to 1:1 scale, execute a function, then return the canvas to
@@ -3680,6 +3687,7 @@ class AbstractInteractiveCanvas {
3680
3687
  class SelectionData {
3681
3688
  constructor(objects) {
3682
3689
  this.objects = objects;
3690
+ console.log(objects[0], "objects");
3683
3691
  this.empty = this.objects.length < 1;
3684
3692
  const selectedObject = this.objects[0];
3685
3693
  this.isText = (selectedObject === null || selectedObject === void 0 ? void 0 : selectedObject.getType()) === ObjectType.TEXT
@@ -2497,7 +2497,7 @@ class Text extends AbstractCanvasObject {
2497
2497
  text: `${lineNumber}.`
2498
2498
  });
2499
2499
  }
2500
- if (method === "fillText" && this.fabricObject.left <= 0) {
2500
+ if (method === "fillText" && this.fabricObject.left <= 3) {
2501
2501
  left = left + this.getOrderedListMargin();
2502
2502
  }
2503
2503
  this.fabricObject.dirty = true;
@@ -3379,6 +3379,8 @@ class AbstractInteractiveCanvas {
3379
3379
  }
3380
3380
  setMultiSelect(value) {
3381
3381
  this.fabricCanvas.selection = value;
3382
+ this.fabricCanvas.selectionColor = value ? "rgba(0,0,0,0.1)" : "transparent"; // Adjust selection color
3383
+ this.fabricCanvas.selectionBorderColor = "transparent";
3382
3384
  this.fabricCanvas.selectionKey = value ? "shiftKey" : null;
3383
3385
  }
3384
3386
  /**
@@ -3620,7 +3622,12 @@ class AbstractInteractiveCanvas {
3620
3622
  }
3621
3623
  findObject(id) {
3622
3624
  //Don't use strict compare here. fabric ids are numbers while ad builder ids are strings... mostly.
3623
- return _.find(this.objects$.value, (object) => object.getId() == id);
3625
+ //return _.find(this.objects$.value, (object: AbstractCanvasObject<any>) => object.getId() == id)!;
3626
+ const foundObject = _.find(this.objects$.value, (object) => object.getId() == id);
3627
+ if (!foundObject) {
3628
+ throw new Error(`Object with id [${id}] not found`);
3629
+ }
3630
+ return foundObject;
3624
3631
  }
3625
3632
  /**
3626
3633
  * Reset zoom and canvas dimensions to 1:1 scale, execute a function, then return the canvas to
@@ -3701,6 +3708,7 @@ class AbstractInteractiveCanvas {
3701
3708
  class SelectionData {
3702
3709
  constructor(objects) {
3703
3710
  this.objects = objects;
3711
+ console.log(objects[0], "objects");
3704
3712
  this.empty = this.objects.length < 1;
3705
3713
  const selectedObject = this.objects[0];
3706
3714
  this.isText = (selectedObject === null || selectedObject === void 0 ? void 0 : selectedObject.getType()) === exports.ObjectType.TEXT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leapfrog/interactive-canvas",
3
- "version": "2.0.20-beta-1",
3
+ "version": "2.0.20-beta-3",
4
4
  "description": "Leapfrog interactive canvas",
5
5
  "files": [
6
6
  "dist"