microboard-temp 0.13.9 → 0.13.11

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.
@@ -22408,10 +22408,10 @@ class RichText extends BaseItem {
22408
22408
  }
22409
22409
  getMaxWidth() {
22410
22410
  if (this.autoSize) {
22411
- return this.editor.maxWidth || this.getTransformedContainer().getWidth();
22411
+ return this.editor.maxWidth || this.container.getWidth();
22412
22412
  }
22413
22413
  if (this.isContainerSet) {
22414
- return this.getTransformedContainer().getWidth();
22414
+ return this.container.getWidth();
22415
22415
  } else {
22416
22416
  return this.containerMaxWidth || this.editor.maxWidth;
22417
22417
  }
@@ -22882,6 +22882,7 @@ class RichText extends BaseItem {
22882
22882
  }
22883
22883
  const { ctx } = context;
22884
22884
  ctx.save();
22885
+ ctx.translate(this.left, this.top);
22885
22886
  const cameraScale = context.getCameraScale();
22886
22887
  const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
22887
22888
  let matrix;
@@ -22890,11 +22891,13 @@ class RichText extends BaseItem {
22890
22891
  } else {
22891
22892
  matrix = this.transformation.toMatrix();
22892
22893
  }
22893
- const { translateX, translateY, scaleX, scaleY } = matrix;
22894
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22895
- context.matrix = scaledMatrix;
22896
- context.applyChanges();
22897
- ctx.translate(this.container.left, this.container.top);
22894
+ const { scaleX, scaleY } = matrix;
22895
+ const shouldScale = !this.isInShape && !this.autoSize;
22896
+ if (shouldScale) {
22897
+ ctx.scale(scaleX * extraScale, scaleY * extraScale);
22898
+ } else if (extraScale !== 1) {
22899
+ ctx.scale(extraScale, extraScale);
22900
+ }
22898
22901
  const shouldClip = this.insideOf === "Shape" || this.insideOf === "Sticker";
22899
22902
  if (shouldClip) {
22900
22903
  ctx.clip(this.clipPath.nativePath);
@@ -23033,9 +23036,8 @@ class RichText extends BaseItem {
23033
23036
  } else {
23034
23037
  matrix = this.transformation.toMatrix();
23035
23038
  }
23036
- const { translateX, translateY, scaleX, scaleY } = matrix;
23037
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
23038
- const transform = `translate(${scaledMatrix.translateX + this.container.left * scaledMatrix.scaleX}px, ${scaledMatrix.translateY + this.container.top * scaledMatrix.scaleY}px) scale(${scaledMatrix.scaleX}, ${scaledMatrix.scaleY})`;
23039
+ const { scaleX, scaleY } = matrix;
23040
+ const transform = `translate(${this.left}px, ${this.top}px) scale(${scaleX * extraScale}, ${scaleY * extraScale})`;
23039
23041
  const transformedWidth = this.getMbr().getWidth();
23040
23042
  const transformedHeight = this.getMbr().getHeight();
23041
23043
  const div = documentFactory.createElement("rich-text");
@@ -40023,7 +40025,9 @@ class Shape extends BaseItem {
40023
40025
  this.subject.publish(this);
40024
40026
  });
40025
40027
  this.text.insideOf = this.itemType;
40028
+ this.transformPath();
40026
40029
  this.updateMbr();
40030
+ this.subject.publish(this);
40027
40031
  }
40028
40032
  saveShapeData() {
40029
40033
  tempStorage.setShapeData({
@@ -40574,6 +40578,8 @@ class Sticker extends BaseItem {
40574
40578
  this.subject.publish(this);
40575
40579
  });
40576
40580
  this.text.updateElement();
40581
+ this.transformPath();
40582
+ this.subject.publish(this);
40577
40583
  }
40578
40584
  emit(operation) {
40579
40585
  if (this.board.events) {
package/dist/cjs/index.js CHANGED
@@ -22408,10 +22408,10 @@ class RichText extends BaseItem {
22408
22408
  }
22409
22409
  getMaxWidth() {
22410
22410
  if (this.autoSize) {
22411
- return this.editor.maxWidth || this.getTransformedContainer().getWidth();
22411
+ return this.editor.maxWidth || this.container.getWidth();
22412
22412
  }
22413
22413
  if (this.isContainerSet) {
22414
- return this.getTransformedContainer().getWidth();
22414
+ return this.container.getWidth();
22415
22415
  } else {
22416
22416
  return this.containerMaxWidth || this.editor.maxWidth;
22417
22417
  }
@@ -22882,6 +22882,7 @@ class RichText extends BaseItem {
22882
22882
  }
22883
22883
  const { ctx } = context;
22884
22884
  ctx.save();
22885
+ ctx.translate(this.left, this.top);
22885
22886
  const cameraScale = context.getCameraScale();
22886
22887
  const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
22887
22888
  let matrix;
@@ -22890,11 +22891,13 @@ class RichText extends BaseItem {
22890
22891
  } else {
22891
22892
  matrix = this.transformation.toMatrix();
22892
22893
  }
22893
- const { translateX, translateY, scaleX, scaleY } = matrix;
22894
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22895
- context.matrix = scaledMatrix;
22896
- context.applyChanges();
22897
- ctx.translate(this.container.left, this.container.top);
22894
+ const { scaleX, scaleY } = matrix;
22895
+ const shouldScale = !this.isInShape && !this.autoSize;
22896
+ if (shouldScale) {
22897
+ ctx.scale(scaleX * extraScale, scaleY * extraScale);
22898
+ } else if (extraScale !== 1) {
22899
+ ctx.scale(extraScale, extraScale);
22900
+ }
22898
22901
  const shouldClip = this.insideOf === "Shape" || this.insideOf === "Sticker";
22899
22902
  if (shouldClip) {
22900
22903
  ctx.clip(this.clipPath.nativePath);
@@ -23033,9 +23036,8 @@ class RichText extends BaseItem {
23033
23036
  } else {
23034
23037
  matrix = this.transformation.toMatrix();
23035
23038
  }
23036
- const { translateX, translateY, scaleX, scaleY } = matrix;
23037
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
23038
- const transform = `translate(${scaledMatrix.translateX + this.container.left * scaledMatrix.scaleX}px, ${scaledMatrix.translateY + this.container.top * scaledMatrix.scaleY}px) scale(${scaledMatrix.scaleX}, ${scaledMatrix.scaleY})`;
23039
+ const { scaleX, scaleY } = matrix;
23040
+ const transform = `translate(${this.left}px, ${this.top}px) scale(${scaleX * extraScale}, ${scaleY * extraScale})`;
23039
23041
  const transformedWidth = this.getMbr().getWidth();
23040
23042
  const transformedHeight = this.getMbr().getHeight();
23041
23043
  const div = documentFactory.createElement("rich-text");
@@ -40023,7 +40025,9 @@ class Shape extends BaseItem {
40023
40025
  this.subject.publish(this);
40024
40026
  });
40025
40027
  this.text.insideOf = this.itemType;
40028
+ this.transformPath();
40026
40029
  this.updateMbr();
40030
+ this.subject.publish(this);
40027
40031
  }
40028
40032
  saveShapeData() {
40029
40033
  tempStorage.setShapeData({
@@ -40574,6 +40578,8 @@ class Sticker extends BaseItem {
40574
40578
  this.subject.publish(this);
40575
40579
  });
40576
40580
  this.text.updateElement();
40581
+ this.transformPath();
40582
+ this.subject.publish(this);
40577
40583
  }
40578
40584
  emit(operation) {
40579
40585
  if (this.board.events) {
package/dist/cjs/node.js CHANGED
@@ -24880,10 +24880,10 @@ class RichText extends BaseItem {
24880
24880
  }
24881
24881
  getMaxWidth() {
24882
24882
  if (this.autoSize) {
24883
- return this.editor.maxWidth || this.getTransformedContainer().getWidth();
24883
+ return this.editor.maxWidth || this.container.getWidth();
24884
24884
  }
24885
24885
  if (this.isContainerSet) {
24886
- return this.getTransformedContainer().getWidth();
24886
+ return this.container.getWidth();
24887
24887
  } else {
24888
24888
  return this.containerMaxWidth || this.editor.maxWidth;
24889
24889
  }
@@ -25354,6 +25354,7 @@ class RichText extends BaseItem {
25354
25354
  }
25355
25355
  const { ctx } = context;
25356
25356
  ctx.save();
25357
+ ctx.translate(this.left, this.top);
25357
25358
  const cameraScale = context.getCameraScale();
25358
25359
  const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
25359
25360
  let matrix;
@@ -25362,11 +25363,13 @@ class RichText extends BaseItem {
25362
25363
  } else {
25363
25364
  matrix = this.transformation.toMatrix();
25364
25365
  }
25365
- const { translateX, translateY, scaleX, scaleY } = matrix;
25366
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
25367
- context.matrix = scaledMatrix;
25368
- context.applyChanges();
25369
- ctx.translate(this.container.left, this.container.top);
25366
+ const { scaleX, scaleY } = matrix;
25367
+ const shouldScale = !this.isInShape && !this.autoSize;
25368
+ if (shouldScale) {
25369
+ ctx.scale(scaleX * extraScale, scaleY * extraScale);
25370
+ } else if (extraScale !== 1) {
25371
+ ctx.scale(extraScale, extraScale);
25372
+ }
25370
25373
  const shouldClip = this.insideOf === "Shape" || this.insideOf === "Sticker";
25371
25374
  if (shouldClip) {
25372
25375
  ctx.clip(this.clipPath.nativePath);
@@ -25505,9 +25508,8 @@ class RichText extends BaseItem {
25505
25508
  } else {
25506
25509
  matrix = this.transformation.toMatrix();
25507
25510
  }
25508
- const { translateX, translateY, scaleX, scaleY } = matrix;
25509
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
25510
- const transform = `translate(${scaledMatrix.translateX + this.container.left * scaledMatrix.scaleX}px, ${scaledMatrix.translateY + this.container.top * scaledMatrix.scaleY}px) scale(${scaledMatrix.scaleX}, ${scaledMatrix.scaleY})`;
25511
+ const { scaleX, scaleY } = matrix;
25512
+ const transform = `translate(${this.left}px, ${this.top}px) scale(${scaleX * extraScale}, ${scaleY * extraScale})`;
25511
25513
  const transformedWidth = this.getMbr().getWidth();
25512
25514
  const transformedHeight = this.getMbr().getHeight();
25513
25515
  const div = documentFactory.createElement("rich-text");
@@ -42496,7 +42498,9 @@ class Shape extends BaseItem {
42496
42498
  this.subject.publish(this);
42497
42499
  });
42498
42500
  this.text.insideOf = this.itemType;
42501
+ this.transformPath();
42499
42502
  this.updateMbr();
42503
+ this.subject.publish(this);
42500
42504
  }
42501
42505
  saveShapeData() {
42502
42506
  tempStorage.setShapeData({
@@ -43047,6 +43051,8 @@ class Sticker extends BaseItem {
43047
43051
  this.subject.publish(this);
43048
43052
  });
43049
43053
  this.text.updateElement();
43054
+ this.transformPath();
43055
+ this.subject.publish(this);
43050
43056
  }
43051
43057
  emit(operation) {
43052
43058
  if (this.board.events) {
@@ -22237,10 +22237,10 @@ class RichText extends BaseItem {
22237
22237
  }
22238
22238
  getMaxWidth() {
22239
22239
  if (this.autoSize) {
22240
- return this.editor.maxWidth || this.getTransformedContainer().getWidth();
22240
+ return this.editor.maxWidth || this.container.getWidth();
22241
22241
  }
22242
22242
  if (this.isContainerSet) {
22243
- return this.getTransformedContainer().getWidth();
22243
+ return this.container.getWidth();
22244
22244
  } else {
22245
22245
  return this.containerMaxWidth || this.editor.maxWidth;
22246
22246
  }
@@ -22711,6 +22711,7 @@ class RichText extends BaseItem {
22711
22711
  }
22712
22712
  const { ctx } = context;
22713
22713
  ctx.save();
22714
+ ctx.translate(this.left, this.top);
22714
22715
  const cameraScale = context.getCameraScale();
22715
22716
  const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
22716
22717
  let matrix;
@@ -22719,11 +22720,13 @@ class RichText extends BaseItem {
22719
22720
  } else {
22720
22721
  matrix = this.transformation.toMatrix();
22721
22722
  }
22722
- const { translateX, translateY, scaleX, scaleY } = matrix;
22723
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22724
- context.matrix = scaledMatrix;
22725
- context.applyChanges();
22726
- ctx.translate(this.container.left, this.container.top);
22723
+ const { scaleX, scaleY } = matrix;
22724
+ const shouldScale = !this.isInShape && !this.autoSize;
22725
+ if (shouldScale) {
22726
+ ctx.scale(scaleX * extraScale, scaleY * extraScale);
22727
+ } else if (extraScale !== 1) {
22728
+ ctx.scale(extraScale, extraScale);
22729
+ }
22727
22730
  const shouldClip = this.insideOf === "Shape" || this.insideOf === "Sticker";
22728
22731
  if (shouldClip) {
22729
22732
  ctx.clip(this.clipPath.nativePath);
@@ -22862,9 +22865,8 @@ class RichText extends BaseItem {
22862
22865
  } else {
22863
22866
  matrix = this.transformation.toMatrix();
22864
22867
  }
22865
- const { translateX, translateY, scaleX, scaleY } = matrix;
22866
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22867
- const transform = `translate(${scaledMatrix.translateX + this.container.left * scaledMatrix.scaleX}px, ${scaledMatrix.translateY + this.container.top * scaledMatrix.scaleY}px) scale(${scaledMatrix.scaleX}, ${scaledMatrix.scaleY})`;
22868
+ const { scaleX, scaleY } = matrix;
22869
+ const transform = `translate(${this.left}px, ${this.top}px) scale(${scaleX * extraScale}, ${scaleY * extraScale})`;
22868
22870
  const transformedWidth = this.getMbr().getWidth();
22869
22871
  const transformedHeight = this.getMbr().getHeight();
22870
22872
  const div = documentFactory.createElement("rich-text");
@@ -39852,7 +39854,9 @@ class Shape extends BaseItem {
39852
39854
  this.subject.publish(this);
39853
39855
  });
39854
39856
  this.text.insideOf = this.itemType;
39857
+ this.transformPath();
39855
39858
  this.updateMbr();
39859
+ this.subject.publish(this);
39856
39860
  }
39857
39861
  saveShapeData() {
39858
39862
  tempStorage.setShapeData({
@@ -40403,6 +40407,8 @@ class Sticker extends BaseItem {
40403
40407
  this.subject.publish(this);
40404
40408
  });
40405
40409
  this.text.updateElement();
40410
+ this.transformPath();
40411
+ this.subject.publish(this);
40406
40412
  }
40407
40413
  emit(operation) {
40408
40414
  if (this.board.events) {
package/dist/esm/index.js CHANGED
@@ -22230,10 +22230,10 @@ class RichText extends BaseItem {
22230
22230
  }
22231
22231
  getMaxWidth() {
22232
22232
  if (this.autoSize) {
22233
- return this.editor.maxWidth || this.getTransformedContainer().getWidth();
22233
+ return this.editor.maxWidth || this.container.getWidth();
22234
22234
  }
22235
22235
  if (this.isContainerSet) {
22236
- return this.getTransformedContainer().getWidth();
22236
+ return this.container.getWidth();
22237
22237
  } else {
22238
22238
  return this.containerMaxWidth || this.editor.maxWidth;
22239
22239
  }
@@ -22704,6 +22704,7 @@ class RichText extends BaseItem {
22704
22704
  }
22705
22705
  const { ctx } = context;
22706
22706
  ctx.save();
22707
+ ctx.translate(this.left, this.top);
22707
22708
  const cameraScale = context.getCameraScale();
22708
22709
  const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
22709
22710
  let matrix;
@@ -22712,11 +22713,13 @@ class RichText extends BaseItem {
22712
22713
  } else {
22713
22714
  matrix = this.transformation.toMatrix();
22714
22715
  }
22715
- const { translateX, translateY, scaleX, scaleY } = matrix;
22716
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22717
- context.matrix = scaledMatrix;
22718
- context.applyChanges();
22719
- ctx.translate(this.container.left, this.container.top);
22716
+ const { scaleX, scaleY } = matrix;
22717
+ const shouldScale = !this.isInShape && !this.autoSize;
22718
+ if (shouldScale) {
22719
+ ctx.scale(scaleX * extraScale, scaleY * extraScale);
22720
+ } else if (extraScale !== 1) {
22721
+ ctx.scale(extraScale, extraScale);
22722
+ }
22720
22723
  const shouldClip = this.insideOf === "Shape" || this.insideOf === "Sticker";
22721
22724
  if (shouldClip) {
22722
22725
  ctx.clip(this.clipPath.nativePath);
@@ -22855,9 +22858,8 @@ class RichText extends BaseItem {
22855
22858
  } else {
22856
22859
  matrix = this.transformation.toMatrix();
22857
22860
  }
22858
- const { translateX, translateY, scaleX, scaleY } = matrix;
22859
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22860
- const transform = `translate(${scaledMatrix.translateX + this.container.left * scaledMatrix.scaleX}px, ${scaledMatrix.translateY + this.container.top * scaledMatrix.scaleY}px) scale(${scaledMatrix.scaleX}, ${scaledMatrix.scaleY})`;
22861
+ const { scaleX, scaleY } = matrix;
22862
+ const transform = `translate(${this.left}px, ${this.top}px) scale(${scaleX * extraScale}, ${scaleY * extraScale})`;
22861
22863
  const transformedWidth = this.getMbr().getWidth();
22862
22864
  const transformedHeight = this.getMbr().getHeight();
22863
22865
  const div = documentFactory.createElement("rich-text");
@@ -39845,7 +39847,9 @@ class Shape extends BaseItem {
39845
39847
  this.subject.publish(this);
39846
39848
  });
39847
39849
  this.text.insideOf = this.itemType;
39850
+ this.transformPath();
39848
39851
  this.updateMbr();
39852
+ this.subject.publish(this);
39849
39853
  }
39850
39854
  saveShapeData() {
39851
39855
  tempStorage.setShapeData({
@@ -40396,6 +40400,8 @@ class Sticker extends BaseItem {
40396
40400
  this.subject.publish(this);
40397
40401
  });
40398
40402
  this.text.updateElement();
40403
+ this.transformPath();
40404
+ this.subject.publish(this);
40399
40405
  }
40400
40406
  emit(operation) {
40401
40407
  if (this.board.events) {
package/dist/esm/node.js CHANGED
@@ -24697,10 +24697,10 @@ class RichText extends BaseItem {
24697
24697
  }
24698
24698
  getMaxWidth() {
24699
24699
  if (this.autoSize) {
24700
- return this.editor.maxWidth || this.getTransformedContainer().getWidth();
24700
+ return this.editor.maxWidth || this.container.getWidth();
24701
24701
  }
24702
24702
  if (this.isContainerSet) {
24703
- return this.getTransformedContainer().getWidth();
24703
+ return this.container.getWidth();
24704
24704
  } else {
24705
24705
  return this.containerMaxWidth || this.editor.maxWidth;
24706
24706
  }
@@ -25171,6 +25171,7 @@ class RichText extends BaseItem {
25171
25171
  }
25172
25172
  const { ctx } = context;
25173
25173
  ctx.save();
25174
+ ctx.translate(this.left, this.top);
25174
25175
  const cameraScale = context.getCameraScale();
25175
25176
  const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
25176
25177
  let matrix;
@@ -25179,11 +25180,13 @@ class RichText extends BaseItem {
25179
25180
  } else {
25180
25181
  matrix = this.transformation.toMatrix();
25181
25182
  }
25182
- const { translateX, translateY, scaleX, scaleY } = matrix;
25183
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
25184
- context.matrix = scaledMatrix;
25185
- context.applyChanges();
25186
- ctx.translate(this.container.left, this.container.top);
25183
+ const { scaleX, scaleY } = matrix;
25184
+ const shouldScale = !this.isInShape && !this.autoSize;
25185
+ if (shouldScale) {
25186
+ ctx.scale(scaleX * extraScale, scaleY * extraScale);
25187
+ } else if (extraScale !== 1) {
25188
+ ctx.scale(extraScale, extraScale);
25189
+ }
25187
25190
  const shouldClip = this.insideOf === "Shape" || this.insideOf === "Sticker";
25188
25191
  if (shouldClip) {
25189
25192
  ctx.clip(this.clipPath.nativePath);
@@ -25322,9 +25325,8 @@ class RichText extends BaseItem {
25322
25325
  } else {
25323
25326
  matrix = this.transformation.toMatrix();
25324
25327
  }
25325
- const { translateX, translateY, scaleX, scaleY } = matrix;
25326
- const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
25327
- const transform = `translate(${scaledMatrix.translateX + this.container.left * scaledMatrix.scaleX}px, ${scaledMatrix.translateY + this.container.top * scaledMatrix.scaleY}px) scale(${scaledMatrix.scaleX}, ${scaledMatrix.scaleY})`;
25328
+ const { scaleX, scaleY } = matrix;
25329
+ const transform = `translate(${this.left}px, ${this.top}px) scale(${scaleX * extraScale}, ${scaleY * extraScale})`;
25328
25330
  const transformedWidth = this.getMbr().getWidth();
25329
25331
  const transformedHeight = this.getMbr().getHeight();
25330
25332
  const div = documentFactory.createElement("rich-text");
@@ -42313,7 +42315,9 @@ class Shape extends BaseItem {
42313
42315
  this.subject.publish(this);
42314
42316
  });
42315
42317
  this.text.insideOf = this.itemType;
42318
+ this.transformPath();
42316
42319
  this.updateMbr();
42320
+ this.subject.publish(this);
42317
42321
  }
42318
42322
  saveShapeData() {
42319
42323
  tempStorage.setShapeData({
@@ -42864,6 +42868,8 @@ class Sticker extends BaseItem {
42864
42868
  this.subject.publish(this);
42865
42869
  });
42866
42870
  this.text.updateElement();
42871
+ this.transformPath();
42872
+ this.subject.publish(this);
42867
42873
  }
42868
42874
  emit(operation) {
42869
42875
  if (this.board.events) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.9",
3
+ "version": "0.13.11",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",