microboard-ui-temp 0.1.129 → 0.1.131

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/dist/index.js CHANGED
@@ -276454,7 +276454,7 @@ class AddScreen extends ShapeTool {
276454
276454
  return true;
276455
276455
  }
276456
276456
  }
276457
- var handPath = new Path2([
276457
+ var screenPath = new Path2([
276458
276458
  new Line(new Point3(0, 0), new Point3(100, 0)),
276459
276459
  new Line(new Point3(100, 0), new Point3(100, 100)),
276460
276460
  new Line(new Point3(100, 100), new Point3(0, 100)),
@@ -276462,7 +276462,8 @@ var handPath = new Path2([
276462
276462
  ], true, "#FFFFFF", "#000000");
276463
276463
  var defaultScreenData = {
276464
276464
  itemType: "Screen",
276465
- ownerId: ""
276465
+ ownerId: "",
276466
+ backgroundUrl: ""
276466
276467
  };
276467
276468
 
276468
276469
  class Screen extends BaseItem {
@@ -276471,6 +276472,8 @@ class Screen extends BaseItem {
276471
276472
  path;
276472
276473
  borderWidth = 1;
276473
276474
  backgroundColor = "#FFFFFF";
276475
+ backgroundUrl = "";
276476
+ backgroundImage = null;
276474
276477
  constructor(board, id2 = "", ownerId = "") {
276475
276478
  super(board, id2, defaultScreenData, true);
276476
276479
  this.ownerId = ownerId;
@@ -276496,6 +276499,9 @@ class Screen extends BaseItem {
276496
276499
  case "setBorderColor":
276497
276500
  this.applyBorderColor(op.newData.borderColor);
276498
276501
  break;
276502
+ case "setBackgroundUrl":
276503
+ this.applyBackgroundUrl(op.newData.backgroundUrl);
276504
+ break;
276499
276505
  }
276500
276506
  break;
276501
276507
  }
@@ -276519,7 +276525,7 @@ class Screen extends BaseItem {
276519
276525
  }
276520
276526
  setBackgroundColor(backgroundColor) {
276521
276527
  this.emit({
276522
- class: "Dice",
276528
+ class: "Screen",
276523
276529
  method: "setBackgroundColor",
276524
276530
  item: [this.getId()],
276525
276531
  newData: { backgroundColor },
@@ -276532,7 +276538,7 @@ class Screen extends BaseItem {
276532
276538
  }
276533
276539
  setBorderWidth(borderWidth) {
276534
276540
  this.emit({
276535
- class: "Dice",
276541
+ class: "Screen",
276536
276542
  method: "setBorderWidth",
276537
276543
  item: [this.getId()],
276538
276544
  newData: { borderWidth },
@@ -276545,18 +276551,37 @@ class Screen extends BaseItem {
276545
276551
  }
276546
276552
  setBorderColor(borderColor) {
276547
276553
  this.emit({
276548
- class: "Dice",
276554
+ class: "Screen",
276549
276555
  method: "setBorderColor",
276550
276556
  item: [this.getId()],
276551
276557
  newData: { borderColor },
276552
276558
  prevData: { borderColor: this.borderColor }
276553
276559
  });
276554
276560
  }
276561
+ applyBackgroundUrl(url) {
276562
+ this.backgroundUrl = url || "";
276563
+ if (url) {
276564
+ this.backgroundImage = new Image;
276565
+ this.backgroundImage.src = url;
276566
+ this.applyBackgroundColor("none");
276567
+ } else {
276568
+ this.backgroundImage = null;
276569
+ }
276570
+ }
276571
+ setBackgroundUrl(url) {
276572
+ this.emit({
276573
+ class: "Screen",
276574
+ method: "setBackgroundUrl",
276575
+ item: [this.getId()],
276576
+ newData: { backgroundUrl: url },
276577
+ prevData: { backgroundUrl: this.backgroundUrl }
276578
+ });
276579
+ }
276555
276580
  applyOwnerId(ownerId) {
276556
276581
  this.ownerId = ownerId;
276557
276582
  }
276558
276583
  transformPath() {
276559
- this.path = handPath.copy();
276584
+ this.path = screenPath.copy();
276560
276585
  this.path.transform(this.transformation.matrix);
276561
276586
  this.path.setBackgroundColor(this.backgroundColor);
276562
276587
  this.path.setBorderColor(this.borderColor);
@@ -276579,6 +276604,13 @@ class Screen extends BaseItem {
276579
276604
  if (this.transformationRenderBlock) {
276580
276605
  return;
276581
276606
  }
276607
+ if (this.backgroundImage && this.backgroundImage.complete) {
276608
+ const ctx = context.ctx;
276609
+ ctx.save();
276610
+ this.transformation.matrix.applyToContext(ctx);
276611
+ ctx.drawImage(this.backgroundImage, 0, 0);
276612
+ ctx.restore();
276613
+ }
276582
276614
  this.path.render(context);
276583
276615
  if (localStorage.getItem("currentUser") === this.ownerId || localStorage.getItem("screenOwnerId") === this.ownerId || !this.ownerId) {
276584
276616
  super.render(context);
@@ -375276,6 +375308,8 @@ function SpreadCards({ rounded = "none" }) {
375276
375308
  card.transformation.translateTo(right + 5 + width2 * index4, top);
375277
375309
  });
375278
375310
  }
375311
+ board.selection.items.removeAll();
375312
+ board.selection.add(cards);
375279
375313
  if (deck.getDeck().length === 0) {
375280
375314
  board.remove(deck);
375281
375315
  }
package/dist/spa.js CHANGED
@@ -276454,7 +276454,7 @@ class AddScreen extends ShapeTool {
276454
276454
  return true;
276455
276455
  }
276456
276456
  }
276457
- var handPath = new Path2([
276457
+ var screenPath = new Path2([
276458
276458
  new Line(new Point3(0, 0), new Point3(100, 0)),
276459
276459
  new Line(new Point3(100, 0), new Point3(100, 100)),
276460
276460
  new Line(new Point3(100, 100), new Point3(0, 100)),
@@ -276462,7 +276462,8 @@ var handPath = new Path2([
276462
276462
  ], true, "#FFFFFF", "#000000");
276463
276463
  var defaultScreenData = {
276464
276464
  itemType: "Screen",
276465
- ownerId: ""
276465
+ ownerId: "",
276466
+ backgroundUrl: ""
276466
276467
  };
276467
276468
 
276468
276469
  class Screen extends BaseItem {
@@ -276471,6 +276472,8 @@ class Screen extends BaseItem {
276471
276472
  path;
276472
276473
  borderWidth = 1;
276473
276474
  backgroundColor = "#FFFFFF";
276475
+ backgroundUrl = "";
276476
+ backgroundImage = null;
276474
276477
  constructor(board, id2 = "", ownerId = "") {
276475
276478
  super(board, id2, defaultScreenData, true);
276476
276479
  this.ownerId = ownerId;
@@ -276496,6 +276499,9 @@ class Screen extends BaseItem {
276496
276499
  case "setBorderColor":
276497
276500
  this.applyBorderColor(op.newData.borderColor);
276498
276501
  break;
276502
+ case "setBackgroundUrl":
276503
+ this.applyBackgroundUrl(op.newData.backgroundUrl);
276504
+ break;
276499
276505
  }
276500
276506
  break;
276501
276507
  }
@@ -276519,7 +276525,7 @@ class Screen extends BaseItem {
276519
276525
  }
276520
276526
  setBackgroundColor(backgroundColor) {
276521
276527
  this.emit({
276522
- class: "Dice",
276528
+ class: "Screen",
276523
276529
  method: "setBackgroundColor",
276524
276530
  item: [this.getId()],
276525
276531
  newData: { backgroundColor },
@@ -276532,7 +276538,7 @@ class Screen extends BaseItem {
276532
276538
  }
276533
276539
  setBorderWidth(borderWidth) {
276534
276540
  this.emit({
276535
- class: "Dice",
276541
+ class: "Screen",
276536
276542
  method: "setBorderWidth",
276537
276543
  item: [this.getId()],
276538
276544
  newData: { borderWidth },
@@ -276545,18 +276551,37 @@ class Screen extends BaseItem {
276545
276551
  }
276546
276552
  setBorderColor(borderColor) {
276547
276553
  this.emit({
276548
- class: "Dice",
276554
+ class: "Screen",
276549
276555
  method: "setBorderColor",
276550
276556
  item: [this.getId()],
276551
276557
  newData: { borderColor },
276552
276558
  prevData: { borderColor: this.borderColor }
276553
276559
  });
276554
276560
  }
276561
+ applyBackgroundUrl(url) {
276562
+ this.backgroundUrl = url || "";
276563
+ if (url) {
276564
+ this.backgroundImage = new Image;
276565
+ this.backgroundImage.src = url;
276566
+ this.applyBackgroundColor("none");
276567
+ } else {
276568
+ this.backgroundImage = null;
276569
+ }
276570
+ }
276571
+ setBackgroundUrl(url) {
276572
+ this.emit({
276573
+ class: "Screen",
276574
+ method: "setBackgroundUrl",
276575
+ item: [this.getId()],
276576
+ newData: { backgroundUrl: url },
276577
+ prevData: { backgroundUrl: this.backgroundUrl }
276578
+ });
276579
+ }
276555
276580
  applyOwnerId(ownerId) {
276556
276581
  this.ownerId = ownerId;
276557
276582
  }
276558
276583
  transformPath() {
276559
- this.path = handPath.copy();
276584
+ this.path = screenPath.copy();
276560
276585
  this.path.transform(this.transformation.matrix);
276561
276586
  this.path.setBackgroundColor(this.backgroundColor);
276562
276587
  this.path.setBorderColor(this.borderColor);
@@ -276579,6 +276604,13 @@ class Screen extends BaseItem {
276579
276604
  if (this.transformationRenderBlock) {
276580
276605
  return;
276581
276606
  }
276607
+ if (this.backgroundImage && this.backgroundImage.complete) {
276608
+ const ctx = context.ctx;
276609
+ ctx.save();
276610
+ this.transformation.matrix.applyToContext(ctx);
276611
+ ctx.drawImage(this.backgroundImage, 0, 0);
276612
+ ctx.restore();
276613
+ }
276582
276614
  this.path.render(context);
276583
276615
  if (localStorage.getItem("currentUser") === this.ownerId || localStorage.getItem("screenOwnerId") === this.ownerId || !this.ownerId) {
276584
276616
  super.render(context);
@@ -375276,6 +375308,8 @@ function SpreadCards({ rounded = "none" }) {
375276
375308
  card.transformation.translateTo(right + 5 + width2 * index4, top);
375277
375309
  });
375278
375310
  }
375311
+ board.selection.items.removeAll();
375312
+ board.selection.add(cards);
375279
375313
  if (deck.getDeck().length === 0) {
375280
375314
  board.remove(deck);
375281
375315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-ui-temp",
3
- "version": "0.1.129",
3
+ "version": "0.1.131",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
@@ -66,7 +66,7 @@
66
66
  "i18next-browser-languagedetector": "^8.2.0",
67
67
  "js-cookie": "^3.0.5",
68
68
  "jwt-decode": "^4.0.0",
69
- "microboard-temp": "^0.5.56",
69
+ "microboard-temp": "^0.5.57",
70
70
  "nanoid": "^5.1.5",
71
71
  "prop-types": "^15.8.1",
72
72
  "react-hot-toast": "2.4.1",