microboard-temp 0.13.6 → 0.13.8

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.
@@ -22521,7 +22521,7 @@ class RichText extends BaseItem {
22521
22521
  matrix = this.transformation.toMatrix();
22522
22522
  }
22523
22523
  const { translateX, translateY, scaleX, scaleY } = matrix;
22524
- const scaledMatrix = new Matrix(translateX, translateY, scaleX, scaleY);
22524
+ const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22525
22525
  return this.container.getTransformed(scaledMatrix);
22526
22526
  }
22527
22527
  emitWithoutApplying = (op) => {
@@ -41030,6 +41030,8 @@ class DefaultFrameData {
41030
41030
 
41031
41031
  // src/Items/Frame/Frame.ts
41032
41032
  var defaultFrameData = new DefaultFrameData;
41033
+ var HEADING_TOP_OFFSET = -45;
41034
+ var HEADING_BOTTOM_OFFSET = -12;
41033
41035
 
41034
41036
  class Frame2 extends BaseItem {
41035
41037
  getItemById;
@@ -41045,7 +41047,7 @@ class Frame2 extends BaseItem {
41045
41047
  parent = "Board";
41046
41048
  transformation;
41047
41049
  subject = new Subject;
41048
- textContainer;
41050
+ textContainer = new Mbr;
41049
41051
  path;
41050
41052
  children = [];
41051
41053
  mbr = new Mbr;
@@ -41066,15 +41068,16 @@ class Frame2 extends BaseItem {
41066
41068
  this.borderOpacity = borderOpacity;
41067
41069
  this.borderStyle = borderStyle;
41068
41070
  this.borderWidth = borderWidth;
41069
- this.textContainer = Frames[this.shapeType].textBounds.copy();
41070
41071
  this.path = Frames[this.shapeType].path.copy();
41071
41072
  this.transformation = new Transformation(this.id, board.events);
41072
41073
  this.linkTo = new LinkTo(this.id, board.events);
41074
+ const textBounds = Frames[this.shapeType].textBounds.copy();
41075
+ textBounds.top = HEADING_TOP_OFFSET;
41076
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
41077
+ this.textContainer = textBounds;
41073
41078
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontSize: 18, fontColor: FRAME_TITLE_COLOR });
41074
41079
  this.text.editor.verticalAlignment = "bottom";
41075
41080
  this.text.setSelectionHorisontalAlignment("left");
41076
- this.textContainer.top = -45;
41077
- this.textContainer.bottom = -12;
41078
41081
  this.text.customTransformationMatrix = () => {
41079
41082
  const matrix = this.transformation.toMatrix();
41080
41083
  return new Matrix(matrix.translateX, matrix.translateY, 1, 1);
@@ -41106,9 +41109,17 @@ class Frame2 extends BaseItem {
41106
41109
  }
41107
41110
  initPath() {
41108
41111
  this.path = Frames[this.shapeType].path.copy();
41109
- this.textContainer = Frames[this.shapeType].textBounds.copy();
41110
- this.text.setContainer(this.textContainer.copy());
41111
- this.text.updateElement();
41112
+ this.updateTextContainer();
41113
+ }
41114
+ updateTextContainer() {
41115
+ const textBounds = Frames[this.shapeType].textBounds.copy();
41116
+ textBounds.top = HEADING_TOP_OFFSET;
41117
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
41118
+ this.textContainer = textBounds;
41119
+ if (this.text) {
41120
+ this.text.setContainer(this.textContainer.copy());
41121
+ this.text.updateElement();
41122
+ }
41112
41123
  }
41113
41124
  getPaths() {
41114
41125
  return this.path;
@@ -41251,6 +41262,7 @@ class Frame2 extends BaseItem {
41251
41262
  }
41252
41263
  if (data.text) {
41253
41264
  this.text.deserialize(data.text);
41265
+ this.updateTextContainer();
41254
41266
  }
41255
41267
  this.canChangeRatio = data.canChangeRatio ?? this.canChangeRatio;
41256
41268
  this.subject.publish(this);
@@ -41266,15 +41278,13 @@ class Frame2 extends BaseItem {
41266
41278
  }
41267
41279
  transformPath(saveProportions = false) {
41268
41280
  this.path = Frames[this.shapeType].path.copy();
41269
- this.textContainer = Frames[this.shapeType].textBounds.copy();
41281
+ this.updateTextContainer();
41270
41282
  if (saveProportions) {
41271
41283
  const newMatrix = this.getSavedProportionsMatrix();
41272
41284
  this.path.transform(newMatrix);
41273
- this.textContainer.transform(newMatrix);
41274
41285
  this.transformation.applyScaleTo(newMatrix.scaleX, newMatrix.scaleY);
41275
41286
  } else {
41276
41287
  this.path.transform(this.transformation.toMatrix());
41277
- this.textContainer.transform(this.transformation.toMatrix());
41278
41288
  }
41279
41289
  this.path.setBackgroundOpacity(this.backgroundOpacity);
41280
41290
  this.path.setBorderWidth(this.borderWidth);
package/dist/cjs/index.js CHANGED
@@ -22521,7 +22521,7 @@ class RichText extends BaseItem {
22521
22521
  matrix = this.transformation.toMatrix();
22522
22522
  }
22523
22523
  const { translateX, translateY, scaleX, scaleY } = matrix;
22524
- const scaledMatrix = new Matrix(translateX, translateY, scaleX, scaleY);
22524
+ const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22525
22525
  return this.container.getTransformed(scaledMatrix);
22526
22526
  }
22527
22527
  emitWithoutApplying = (op) => {
@@ -41030,6 +41030,8 @@ class DefaultFrameData {
41030
41030
 
41031
41031
  // src/Items/Frame/Frame.ts
41032
41032
  var defaultFrameData = new DefaultFrameData;
41033
+ var HEADING_TOP_OFFSET = -45;
41034
+ var HEADING_BOTTOM_OFFSET = -12;
41033
41035
 
41034
41036
  class Frame2 extends BaseItem {
41035
41037
  getItemById;
@@ -41045,7 +41047,7 @@ class Frame2 extends BaseItem {
41045
41047
  parent = "Board";
41046
41048
  transformation;
41047
41049
  subject = new Subject;
41048
- textContainer;
41050
+ textContainer = new Mbr;
41049
41051
  path;
41050
41052
  children = [];
41051
41053
  mbr = new Mbr;
@@ -41066,15 +41068,16 @@ class Frame2 extends BaseItem {
41066
41068
  this.borderOpacity = borderOpacity;
41067
41069
  this.borderStyle = borderStyle;
41068
41070
  this.borderWidth = borderWidth;
41069
- this.textContainer = Frames[this.shapeType].textBounds.copy();
41070
41071
  this.path = Frames[this.shapeType].path.copy();
41071
41072
  this.transformation = new Transformation(this.id, board.events);
41072
41073
  this.linkTo = new LinkTo(this.id, board.events);
41074
+ const textBounds = Frames[this.shapeType].textBounds.copy();
41075
+ textBounds.top = HEADING_TOP_OFFSET;
41076
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
41077
+ this.textContainer = textBounds;
41073
41078
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontSize: 18, fontColor: FRAME_TITLE_COLOR });
41074
41079
  this.text.editor.verticalAlignment = "bottom";
41075
41080
  this.text.setSelectionHorisontalAlignment("left");
41076
- this.textContainer.top = -45;
41077
- this.textContainer.bottom = -12;
41078
41081
  this.text.customTransformationMatrix = () => {
41079
41082
  const matrix = this.transformation.toMatrix();
41080
41083
  return new Matrix(matrix.translateX, matrix.translateY, 1, 1);
@@ -41106,9 +41109,17 @@ class Frame2 extends BaseItem {
41106
41109
  }
41107
41110
  initPath() {
41108
41111
  this.path = Frames[this.shapeType].path.copy();
41109
- this.textContainer = Frames[this.shapeType].textBounds.copy();
41110
- this.text.setContainer(this.textContainer.copy());
41111
- this.text.updateElement();
41112
+ this.updateTextContainer();
41113
+ }
41114
+ updateTextContainer() {
41115
+ const textBounds = Frames[this.shapeType].textBounds.copy();
41116
+ textBounds.top = HEADING_TOP_OFFSET;
41117
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
41118
+ this.textContainer = textBounds;
41119
+ if (this.text) {
41120
+ this.text.setContainer(this.textContainer.copy());
41121
+ this.text.updateElement();
41122
+ }
41112
41123
  }
41113
41124
  getPaths() {
41114
41125
  return this.path;
@@ -41251,6 +41262,7 @@ class Frame2 extends BaseItem {
41251
41262
  }
41252
41263
  if (data.text) {
41253
41264
  this.text.deserialize(data.text);
41265
+ this.updateTextContainer();
41254
41266
  }
41255
41267
  this.canChangeRatio = data.canChangeRatio ?? this.canChangeRatio;
41256
41268
  this.subject.publish(this);
@@ -41266,15 +41278,13 @@ class Frame2 extends BaseItem {
41266
41278
  }
41267
41279
  transformPath(saveProportions = false) {
41268
41280
  this.path = Frames[this.shapeType].path.copy();
41269
- this.textContainer = Frames[this.shapeType].textBounds.copy();
41281
+ this.updateTextContainer();
41270
41282
  if (saveProportions) {
41271
41283
  const newMatrix = this.getSavedProportionsMatrix();
41272
41284
  this.path.transform(newMatrix);
41273
- this.textContainer.transform(newMatrix);
41274
41285
  this.transformation.applyScaleTo(newMatrix.scaleX, newMatrix.scaleY);
41275
41286
  } else {
41276
41287
  this.path.transform(this.transformation.toMatrix());
41277
- this.textContainer.transform(this.transformation.toMatrix());
41278
41288
  }
41279
41289
  this.path.setBackgroundOpacity(this.backgroundOpacity);
41280
41290
  this.path.setBorderWidth(this.borderWidth);
package/dist/cjs/node.js CHANGED
@@ -24993,7 +24993,7 @@ class RichText extends BaseItem {
24993
24993
  matrix = this.transformation.toMatrix();
24994
24994
  }
24995
24995
  const { translateX, translateY, scaleX, scaleY } = matrix;
24996
- const scaledMatrix = new Matrix(translateX, translateY, scaleX, scaleY);
24996
+ const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
24997
24997
  return this.container.getTransformed(scaledMatrix);
24998
24998
  }
24999
24999
  emitWithoutApplying = (op) => {
@@ -43503,6 +43503,8 @@ class DefaultFrameData {
43503
43503
 
43504
43504
  // src/Items/Frame/Frame.ts
43505
43505
  var defaultFrameData = new DefaultFrameData;
43506
+ var HEADING_TOP_OFFSET = -45;
43507
+ var HEADING_BOTTOM_OFFSET = -12;
43506
43508
 
43507
43509
  class Frame2 extends BaseItem {
43508
43510
  getItemById;
@@ -43518,7 +43520,7 @@ class Frame2 extends BaseItem {
43518
43520
  parent = "Board";
43519
43521
  transformation;
43520
43522
  subject = new Subject;
43521
- textContainer;
43523
+ textContainer = new Mbr;
43522
43524
  path;
43523
43525
  children = [];
43524
43526
  mbr = new Mbr;
@@ -43539,15 +43541,16 @@ class Frame2 extends BaseItem {
43539
43541
  this.borderOpacity = borderOpacity;
43540
43542
  this.borderStyle = borderStyle;
43541
43543
  this.borderWidth = borderWidth;
43542
- this.textContainer = Frames[this.shapeType].textBounds.copy();
43543
43544
  this.path = Frames[this.shapeType].path.copy();
43544
43545
  this.transformation = new Transformation(this.id, board.events);
43545
43546
  this.linkTo = new LinkTo(this.id, board.events);
43547
+ const textBounds = Frames[this.shapeType].textBounds.copy();
43548
+ textBounds.top = HEADING_TOP_OFFSET;
43549
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
43550
+ this.textContainer = textBounds;
43546
43551
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontSize: 18, fontColor: FRAME_TITLE_COLOR });
43547
43552
  this.text.editor.verticalAlignment = "bottom";
43548
43553
  this.text.setSelectionHorisontalAlignment("left");
43549
- this.textContainer.top = -45;
43550
- this.textContainer.bottom = -12;
43551
43554
  this.text.customTransformationMatrix = () => {
43552
43555
  const matrix = this.transformation.toMatrix();
43553
43556
  return new Matrix(matrix.translateX, matrix.translateY, 1, 1);
@@ -43579,9 +43582,17 @@ class Frame2 extends BaseItem {
43579
43582
  }
43580
43583
  initPath() {
43581
43584
  this.path = Frames[this.shapeType].path.copy();
43582
- this.textContainer = Frames[this.shapeType].textBounds.copy();
43583
- this.text.setContainer(this.textContainer.copy());
43584
- this.text.updateElement();
43585
+ this.updateTextContainer();
43586
+ }
43587
+ updateTextContainer() {
43588
+ const textBounds = Frames[this.shapeType].textBounds.copy();
43589
+ textBounds.top = HEADING_TOP_OFFSET;
43590
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
43591
+ this.textContainer = textBounds;
43592
+ if (this.text) {
43593
+ this.text.setContainer(this.textContainer.copy());
43594
+ this.text.updateElement();
43595
+ }
43585
43596
  }
43586
43597
  getPaths() {
43587
43598
  return this.path;
@@ -43724,6 +43735,7 @@ class Frame2 extends BaseItem {
43724
43735
  }
43725
43736
  if (data.text) {
43726
43737
  this.text.deserialize(data.text);
43738
+ this.updateTextContainer();
43727
43739
  }
43728
43740
  this.canChangeRatio = data.canChangeRatio ?? this.canChangeRatio;
43729
43741
  this.subject.publish(this);
@@ -43739,15 +43751,13 @@ class Frame2 extends BaseItem {
43739
43751
  }
43740
43752
  transformPath(saveProportions = false) {
43741
43753
  this.path = Frames[this.shapeType].path.copy();
43742
- this.textContainer = Frames[this.shapeType].textBounds.copy();
43754
+ this.updateTextContainer();
43743
43755
  if (saveProportions) {
43744
43756
  const newMatrix = this.getSavedProportionsMatrix();
43745
43757
  this.path.transform(newMatrix);
43746
- this.textContainer.transform(newMatrix);
43747
43758
  this.transformation.applyScaleTo(newMatrix.scaleX, newMatrix.scaleY);
43748
43759
  } else {
43749
43760
  this.path.transform(this.transformation.toMatrix());
43750
- this.textContainer.transform(this.transformation.toMatrix());
43751
43761
  }
43752
43762
  this.path.setBackgroundOpacity(this.backgroundOpacity);
43753
43763
  this.path.setBorderWidth(this.borderWidth);
@@ -22350,7 +22350,7 @@ class RichText extends BaseItem {
22350
22350
  matrix = this.transformation.toMatrix();
22351
22351
  }
22352
22352
  const { translateX, translateY, scaleX, scaleY } = matrix;
22353
- const scaledMatrix = new Matrix(translateX, translateY, scaleX, scaleY);
22353
+ const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22354
22354
  return this.container.getTransformed(scaledMatrix);
22355
22355
  }
22356
22356
  emitWithoutApplying = (op) => {
@@ -40859,6 +40859,8 @@ class DefaultFrameData {
40859
40859
 
40860
40860
  // src/Items/Frame/Frame.ts
40861
40861
  var defaultFrameData = new DefaultFrameData;
40862
+ var HEADING_TOP_OFFSET = -45;
40863
+ var HEADING_BOTTOM_OFFSET = -12;
40862
40864
 
40863
40865
  class Frame2 extends BaseItem {
40864
40866
  getItemById;
@@ -40874,7 +40876,7 @@ class Frame2 extends BaseItem {
40874
40876
  parent = "Board";
40875
40877
  transformation;
40876
40878
  subject = new Subject;
40877
- textContainer;
40879
+ textContainer = new Mbr;
40878
40880
  path;
40879
40881
  children = [];
40880
40882
  mbr = new Mbr;
@@ -40895,15 +40897,16 @@ class Frame2 extends BaseItem {
40895
40897
  this.borderOpacity = borderOpacity;
40896
40898
  this.borderStyle = borderStyle;
40897
40899
  this.borderWidth = borderWidth;
40898
- this.textContainer = Frames[this.shapeType].textBounds.copy();
40899
40900
  this.path = Frames[this.shapeType].path.copy();
40900
40901
  this.transformation = new Transformation(this.id, board.events);
40901
40902
  this.linkTo = new LinkTo(this.id, board.events);
40903
+ const textBounds = Frames[this.shapeType].textBounds.copy();
40904
+ textBounds.top = HEADING_TOP_OFFSET;
40905
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
40906
+ this.textContainer = textBounds;
40902
40907
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontSize: 18, fontColor: FRAME_TITLE_COLOR });
40903
40908
  this.text.editor.verticalAlignment = "bottom";
40904
40909
  this.text.setSelectionHorisontalAlignment("left");
40905
- this.textContainer.top = -45;
40906
- this.textContainer.bottom = -12;
40907
40910
  this.text.customTransformationMatrix = () => {
40908
40911
  const matrix = this.transformation.toMatrix();
40909
40912
  return new Matrix(matrix.translateX, matrix.translateY, 1, 1);
@@ -40935,9 +40938,17 @@ class Frame2 extends BaseItem {
40935
40938
  }
40936
40939
  initPath() {
40937
40940
  this.path = Frames[this.shapeType].path.copy();
40938
- this.textContainer = Frames[this.shapeType].textBounds.copy();
40939
- this.text.setContainer(this.textContainer.copy());
40940
- this.text.updateElement();
40941
+ this.updateTextContainer();
40942
+ }
40943
+ updateTextContainer() {
40944
+ const textBounds = Frames[this.shapeType].textBounds.copy();
40945
+ textBounds.top = HEADING_TOP_OFFSET;
40946
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
40947
+ this.textContainer = textBounds;
40948
+ if (this.text) {
40949
+ this.text.setContainer(this.textContainer.copy());
40950
+ this.text.updateElement();
40951
+ }
40941
40952
  }
40942
40953
  getPaths() {
40943
40954
  return this.path;
@@ -41080,6 +41091,7 @@ class Frame2 extends BaseItem {
41080
41091
  }
41081
41092
  if (data.text) {
41082
41093
  this.text.deserialize(data.text);
41094
+ this.updateTextContainer();
41083
41095
  }
41084
41096
  this.canChangeRatio = data.canChangeRatio ?? this.canChangeRatio;
41085
41097
  this.subject.publish(this);
@@ -41095,15 +41107,13 @@ class Frame2 extends BaseItem {
41095
41107
  }
41096
41108
  transformPath(saveProportions = false) {
41097
41109
  this.path = Frames[this.shapeType].path.copy();
41098
- this.textContainer = Frames[this.shapeType].textBounds.copy();
41110
+ this.updateTextContainer();
41099
41111
  if (saveProportions) {
41100
41112
  const newMatrix = this.getSavedProportionsMatrix();
41101
41113
  this.path.transform(newMatrix);
41102
- this.textContainer.transform(newMatrix);
41103
41114
  this.transformation.applyScaleTo(newMatrix.scaleX, newMatrix.scaleY);
41104
41115
  } else {
41105
41116
  this.path.transform(this.transformation.toMatrix());
41106
- this.textContainer.transform(this.transformation.toMatrix());
41107
41117
  }
41108
41118
  this.path.setBackgroundOpacity(this.backgroundOpacity);
41109
41119
  this.path.setBorderWidth(this.borderWidth);
package/dist/esm/index.js CHANGED
@@ -22343,7 +22343,7 @@ class RichText extends BaseItem {
22343
22343
  matrix = this.transformation.toMatrix();
22344
22344
  }
22345
22345
  const { translateX, translateY, scaleX, scaleY } = matrix;
22346
- const scaledMatrix = new Matrix(translateX, translateY, scaleX, scaleY);
22346
+ const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
22347
22347
  return this.container.getTransformed(scaledMatrix);
22348
22348
  }
22349
22349
  emitWithoutApplying = (op) => {
@@ -40852,6 +40852,8 @@ class DefaultFrameData {
40852
40852
 
40853
40853
  // src/Items/Frame/Frame.ts
40854
40854
  var defaultFrameData = new DefaultFrameData;
40855
+ var HEADING_TOP_OFFSET = -45;
40856
+ var HEADING_BOTTOM_OFFSET = -12;
40855
40857
 
40856
40858
  class Frame2 extends BaseItem {
40857
40859
  getItemById;
@@ -40867,7 +40869,7 @@ class Frame2 extends BaseItem {
40867
40869
  parent = "Board";
40868
40870
  transformation;
40869
40871
  subject = new Subject;
40870
- textContainer;
40872
+ textContainer = new Mbr;
40871
40873
  path;
40872
40874
  children = [];
40873
40875
  mbr = new Mbr;
@@ -40888,15 +40890,16 @@ class Frame2 extends BaseItem {
40888
40890
  this.borderOpacity = borderOpacity;
40889
40891
  this.borderStyle = borderStyle;
40890
40892
  this.borderWidth = borderWidth;
40891
- this.textContainer = Frames[this.shapeType].textBounds.copy();
40892
40893
  this.path = Frames[this.shapeType].path.copy();
40893
40894
  this.transformation = new Transformation(this.id, board.events);
40894
40895
  this.linkTo = new LinkTo(this.id, board.events);
40896
+ const textBounds = Frames[this.shapeType].textBounds.copy();
40897
+ textBounds.top = HEADING_TOP_OFFSET;
40898
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
40899
+ this.textContainer = textBounds;
40895
40900
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontSize: 18, fontColor: FRAME_TITLE_COLOR });
40896
40901
  this.text.editor.verticalAlignment = "bottom";
40897
40902
  this.text.setSelectionHorisontalAlignment("left");
40898
- this.textContainer.top = -45;
40899
- this.textContainer.bottom = -12;
40900
40903
  this.text.customTransformationMatrix = () => {
40901
40904
  const matrix = this.transformation.toMatrix();
40902
40905
  return new Matrix(matrix.translateX, matrix.translateY, 1, 1);
@@ -40928,9 +40931,17 @@ class Frame2 extends BaseItem {
40928
40931
  }
40929
40932
  initPath() {
40930
40933
  this.path = Frames[this.shapeType].path.copy();
40931
- this.textContainer = Frames[this.shapeType].textBounds.copy();
40932
- this.text.setContainer(this.textContainer.copy());
40933
- this.text.updateElement();
40934
+ this.updateTextContainer();
40935
+ }
40936
+ updateTextContainer() {
40937
+ const textBounds = Frames[this.shapeType].textBounds.copy();
40938
+ textBounds.top = HEADING_TOP_OFFSET;
40939
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
40940
+ this.textContainer = textBounds;
40941
+ if (this.text) {
40942
+ this.text.setContainer(this.textContainer.copy());
40943
+ this.text.updateElement();
40944
+ }
40934
40945
  }
40935
40946
  getPaths() {
40936
40947
  return this.path;
@@ -41073,6 +41084,7 @@ class Frame2 extends BaseItem {
41073
41084
  }
41074
41085
  if (data.text) {
41075
41086
  this.text.deserialize(data.text);
41087
+ this.updateTextContainer();
41076
41088
  }
41077
41089
  this.canChangeRatio = data.canChangeRatio ?? this.canChangeRatio;
41078
41090
  this.subject.publish(this);
@@ -41088,15 +41100,13 @@ class Frame2 extends BaseItem {
41088
41100
  }
41089
41101
  transformPath(saveProportions = false) {
41090
41102
  this.path = Frames[this.shapeType].path.copy();
41091
- this.textContainer = Frames[this.shapeType].textBounds.copy();
41103
+ this.updateTextContainer();
41092
41104
  if (saveProportions) {
41093
41105
  const newMatrix = this.getSavedProportionsMatrix();
41094
41106
  this.path.transform(newMatrix);
41095
- this.textContainer.transform(newMatrix);
41096
41107
  this.transformation.applyScaleTo(newMatrix.scaleX, newMatrix.scaleY);
41097
41108
  } else {
41098
41109
  this.path.transform(this.transformation.toMatrix());
41099
- this.textContainer.transform(this.transformation.toMatrix());
41100
41110
  }
41101
41111
  this.path.setBackgroundOpacity(this.backgroundOpacity);
41102
41112
  this.path.setBorderWidth(this.borderWidth);
package/dist/esm/node.js CHANGED
@@ -24810,7 +24810,7 @@ class RichText extends BaseItem {
24810
24810
  matrix = this.transformation.toMatrix();
24811
24811
  }
24812
24812
  const { translateX, translateY, scaleX, scaleY } = matrix;
24813
- const scaledMatrix = new Matrix(translateX, translateY, scaleX, scaleY);
24813
+ const scaledMatrix = new Matrix(translateX, translateY, scaleX * extraScale, scaleY * extraScale);
24814
24814
  return this.container.getTransformed(scaledMatrix);
24815
24815
  }
24816
24816
  emitWithoutApplying = (op) => {
@@ -43320,6 +43320,8 @@ class DefaultFrameData {
43320
43320
 
43321
43321
  // src/Items/Frame/Frame.ts
43322
43322
  var defaultFrameData = new DefaultFrameData;
43323
+ var HEADING_TOP_OFFSET = -45;
43324
+ var HEADING_BOTTOM_OFFSET = -12;
43323
43325
 
43324
43326
  class Frame2 extends BaseItem {
43325
43327
  getItemById;
@@ -43335,7 +43337,7 @@ class Frame2 extends BaseItem {
43335
43337
  parent = "Board";
43336
43338
  transformation;
43337
43339
  subject = new Subject;
43338
- textContainer;
43340
+ textContainer = new Mbr;
43339
43341
  path;
43340
43342
  children = [];
43341
43343
  mbr = new Mbr;
@@ -43356,15 +43358,16 @@ class Frame2 extends BaseItem {
43356
43358
  this.borderOpacity = borderOpacity;
43357
43359
  this.borderStyle = borderStyle;
43358
43360
  this.borderWidth = borderWidth;
43359
- this.textContainer = Frames[this.shapeType].textBounds.copy();
43360
43361
  this.path = Frames[this.shapeType].path.copy();
43361
43362
  this.transformation = new Transformation(this.id, board.events);
43362
43363
  this.linkTo = new LinkTo(this.id, board.events);
43364
+ const textBounds = Frames[this.shapeType].textBounds.copy();
43365
+ textBounds.top = HEADING_TOP_OFFSET;
43366
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
43367
+ this.textContainer = textBounds;
43363
43368
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontSize: 18, fontColor: FRAME_TITLE_COLOR });
43364
43369
  this.text.editor.verticalAlignment = "bottom";
43365
43370
  this.text.setSelectionHorisontalAlignment("left");
43366
- this.textContainer.top = -45;
43367
- this.textContainer.bottom = -12;
43368
43371
  this.text.customTransformationMatrix = () => {
43369
43372
  const matrix = this.transformation.toMatrix();
43370
43373
  return new Matrix(matrix.translateX, matrix.translateY, 1, 1);
@@ -43396,9 +43399,17 @@ class Frame2 extends BaseItem {
43396
43399
  }
43397
43400
  initPath() {
43398
43401
  this.path = Frames[this.shapeType].path.copy();
43399
- this.textContainer = Frames[this.shapeType].textBounds.copy();
43400
- this.text.setContainer(this.textContainer.copy());
43401
- this.text.updateElement();
43402
+ this.updateTextContainer();
43403
+ }
43404
+ updateTextContainer() {
43405
+ const textBounds = Frames[this.shapeType].textBounds.copy();
43406
+ textBounds.top = HEADING_TOP_OFFSET;
43407
+ textBounds.bottom = HEADING_BOTTOM_OFFSET;
43408
+ this.textContainer = textBounds;
43409
+ if (this.text) {
43410
+ this.text.setContainer(this.textContainer.copy());
43411
+ this.text.updateElement();
43412
+ }
43402
43413
  }
43403
43414
  getPaths() {
43404
43415
  return this.path;
@@ -43541,6 +43552,7 @@ class Frame2 extends BaseItem {
43541
43552
  }
43542
43553
  if (data.text) {
43543
43554
  this.text.deserialize(data.text);
43555
+ this.updateTextContainer();
43544
43556
  }
43545
43557
  this.canChangeRatio = data.canChangeRatio ?? this.canChangeRatio;
43546
43558
  this.subject.publish(this);
@@ -43556,15 +43568,13 @@ class Frame2 extends BaseItem {
43556
43568
  }
43557
43569
  transformPath(saveProportions = false) {
43558
43570
  this.path = Frames[this.shapeType].path.copy();
43559
- this.textContainer = Frames[this.shapeType].textBounds.copy();
43571
+ this.updateTextContainer();
43560
43572
  if (saveProportions) {
43561
43573
  const newMatrix = this.getSavedProportionsMatrix();
43562
43574
  this.path.transform(newMatrix);
43563
- this.textContainer.transform(newMatrix);
43564
43575
  this.transformation.applyScaleTo(newMatrix.scaleX, newMatrix.scaleY);
43565
43576
  } else {
43566
43577
  this.path.transform(this.transformation.toMatrix());
43567
- this.textContainer.transform(this.transformation.toMatrix());
43568
43578
  }
43569
43579
  this.path.setBackgroundOpacity(this.backgroundOpacity);
43570
43580
  this.path.setBorderWidth(this.borderWidth);
@@ -52,6 +52,7 @@ export declare class Frame extends BaseItem {
52
52
  * false - if outside of the frame
53
53
  */
54
54
  private initPath;
55
+ private updateTextContainer;
55
56
  getPaths(): Path | Paths;
56
57
  getPath(): Path | Paths;
57
58
  copyPaths(): Path | Paths;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.6",
3
+ "version": "0.13.8",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",