microboard-temp 0.11.7 → 0.11.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.
@@ -22412,8 +22412,14 @@ class RichText extends BaseItem {
22412
22412
  left = container.left;
22413
22413
  top = container.top;
22414
22414
  }
22415
+ const point3 = new Point(left, top);
22416
+ if (this.worldMatrixGetter) {
22417
+ this.worldMatrixGetter().apply(point3);
22418
+ } else {
22419
+ this.getParentWorldMatrix().apply(point3);
22420
+ }
22415
22421
  return {
22416
- point: new Point(left, top),
22422
+ point: point3,
22417
22423
  width,
22418
22424
  height,
22419
22425
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -40477,7 +40483,7 @@ class Sticker extends BaseItem {
40477
40483
  this.linkTo = new LinkTo(this.id, this.board.events);
40478
40484
  this.transformation = new Transformation(this.id, this.board.events);
40479
40485
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
40480
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
40486
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
40481
40487
  this.transformation.subject.subscribe((_subject, op) => {
40482
40488
  this.transformPath();
40483
40489
  if (op.method === "applyMatrix") {
@@ -53413,18 +53419,19 @@ class BoardSelection {
53413
53419
  }
53414
53420
  }
53415
53421
  setTextToEdit(item) {
53416
- if (this.textToEdit) {
53422
+ const text5 = item?.getRichText();
53423
+ if (this.textToEdit && this.textToEdit !== text5) {
53417
53424
  this.textToEdit.updateElement();
53418
53425
  this.textToEdit.enableRender();
53419
53426
  }
53420
- if (!(item && item.getRichText())) {
53427
+ if (!text5) {
53421
53428
  this.textToEdit = undefined;
53422
53429
  return;
53423
53430
  }
53424
- const text5 = item.getRichText();
53425
- if (!text5) {
53431
+ if (this.textToEdit === text5) {
53426
53432
  return;
53427
53433
  }
53434
+ this.textToEdit = text5;
53428
53435
  if (text5.isEmpty()) {
53429
53436
  const textColor = tempStorage.getFontColor(item.itemType);
53430
53437
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -53458,7 +53465,6 @@ class BoardSelection {
53458
53465
  this.setVerticalAlignment(verticalAlignment);
53459
53466
  }
53460
53467
  }
53461
- this.textToEdit = text5;
53462
53468
  text5.editor.selectWholeText();
53463
53469
  this.textToEdit.disableRender();
53464
53470
  this.board.items.subject.publish(this.board.items);
package/dist/cjs/index.js CHANGED
@@ -22412,8 +22412,14 @@ class RichText extends BaseItem {
22412
22412
  left = container.left;
22413
22413
  top = container.top;
22414
22414
  }
22415
+ const point3 = new Point(left, top);
22416
+ if (this.worldMatrixGetter) {
22417
+ this.worldMatrixGetter().apply(point3);
22418
+ } else {
22419
+ this.getParentWorldMatrix().apply(point3);
22420
+ }
22415
22421
  return {
22416
- point: new Point(left, top),
22422
+ point: point3,
22417
22423
  width,
22418
22424
  height,
22419
22425
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -40477,7 +40483,7 @@ class Sticker extends BaseItem {
40477
40483
  this.linkTo = new LinkTo(this.id, this.board.events);
40478
40484
  this.transformation = new Transformation(this.id, this.board.events);
40479
40485
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
40480
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
40486
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
40481
40487
  this.transformation.subject.subscribe((_subject, op) => {
40482
40488
  this.transformPath();
40483
40489
  if (op.method === "applyMatrix") {
@@ -53413,18 +53419,19 @@ class BoardSelection {
53413
53419
  }
53414
53420
  }
53415
53421
  setTextToEdit(item) {
53416
- if (this.textToEdit) {
53422
+ const text5 = item?.getRichText();
53423
+ if (this.textToEdit && this.textToEdit !== text5) {
53417
53424
  this.textToEdit.updateElement();
53418
53425
  this.textToEdit.enableRender();
53419
53426
  }
53420
- if (!(item && item.getRichText())) {
53427
+ if (!text5) {
53421
53428
  this.textToEdit = undefined;
53422
53429
  return;
53423
53430
  }
53424
- const text5 = item.getRichText();
53425
- if (!text5) {
53431
+ if (this.textToEdit === text5) {
53426
53432
  return;
53427
53433
  }
53434
+ this.textToEdit = text5;
53428
53435
  if (text5.isEmpty()) {
53429
53436
  const textColor = tempStorage.getFontColor(item.itemType);
53430
53437
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -53458,7 +53465,6 @@ class BoardSelection {
53458
53465
  this.setVerticalAlignment(verticalAlignment);
53459
53466
  }
53460
53467
  }
53461
- this.textToEdit = text5;
53462
53468
  text5.editor.selectWholeText();
53463
53469
  this.textToEdit.disableRender();
53464
53470
  this.board.items.subject.publish(this.board.items);
package/dist/cjs/node.js CHANGED
@@ -24884,8 +24884,14 @@ class RichText extends BaseItem {
24884
24884
  left = container.left;
24885
24885
  top = container.top;
24886
24886
  }
24887
+ const point3 = new Point(left, top);
24888
+ if (this.worldMatrixGetter) {
24889
+ this.worldMatrixGetter().apply(point3);
24890
+ } else {
24891
+ this.getParentWorldMatrix().apply(point3);
24892
+ }
24887
24893
  return {
24888
- point: new Point(left, top),
24894
+ point: point3,
24889
24895
  width,
24890
24896
  height,
24891
24897
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -42950,7 +42956,7 @@ class Sticker extends BaseItem {
42950
42956
  this.linkTo = new LinkTo(this.id, this.board.events);
42951
42957
  this.transformation = new Transformation(this.id, this.board.events);
42952
42958
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
42953
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
42959
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
42954
42960
  this.transformation.subject.subscribe((_subject, op) => {
42955
42961
  this.transformPath();
42956
42962
  if (op.method === "applyMatrix") {
@@ -55886,18 +55892,19 @@ class BoardSelection {
55886
55892
  }
55887
55893
  }
55888
55894
  setTextToEdit(item) {
55889
- if (this.textToEdit) {
55895
+ const text5 = item?.getRichText();
55896
+ if (this.textToEdit && this.textToEdit !== text5) {
55890
55897
  this.textToEdit.updateElement();
55891
55898
  this.textToEdit.enableRender();
55892
55899
  }
55893
- if (!(item && item.getRichText())) {
55900
+ if (!text5) {
55894
55901
  this.textToEdit = undefined;
55895
55902
  return;
55896
55903
  }
55897
- const text5 = item.getRichText();
55898
- if (!text5) {
55904
+ if (this.textToEdit === text5) {
55899
55905
  return;
55900
55906
  }
55907
+ this.textToEdit = text5;
55901
55908
  if (text5.isEmpty()) {
55902
55909
  const textColor = tempStorage.getFontColor(item.itemType);
55903
55910
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -55931,7 +55938,6 @@ class BoardSelection {
55931
55938
  this.setVerticalAlignment(verticalAlignment);
55932
55939
  }
55933
55940
  }
55934
- this.textToEdit = text5;
55935
55941
  text5.editor.selectWholeText();
55936
55942
  this.textToEdit.disableRender();
55937
55943
  this.board.items.subject.publish(this.board.items);
@@ -22241,8 +22241,14 @@ class RichText extends BaseItem {
22241
22241
  left = container.left;
22242
22242
  top = container.top;
22243
22243
  }
22244
+ const point3 = new Point(left, top);
22245
+ if (this.worldMatrixGetter) {
22246
+ this.worldMatrixGetter().apply(point3);
22247
+ } else {
22248
+ this.getParentWorldMatrix().apply(point3);
22249
+ }
22244
22250
  return {
22245
- point: new Point(left, top),
22251
+ point: point3,
22246
22252
  width,
22247
22253
  height,
22248
22254
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -40306,7 +40312,7 @@ class Sticker extends BaseItem {
40306
40312
  this.linkTo = new LinkTo(this.id, this.board.events);
40307
40313
  this.transformation = new Transformation(this.id, this.board.events);
40308
40314
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
40309
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
40315
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
40310
40316
  this.transformation.subject.subscribe((_subject, op) => {
40311
40317
  this.transformPath();
40312
40318
  if (op.method === "applyMatrix") {
@@ -53242,18 +53248,19 @@ class BoardSelection {
53242
53248
  }
53243
53249
  }
53244
53250
  setTextToEdit(item) {
53245
- if (this.textToEdit) {
53251
+ const text5 = item?.getRichText();
53252
+ if (this.textToEdit && this.textToEdit !== text5) {
53246
53253
  this.textToEdit.updateElement();
53247
53254
  this.textToEdit.enableRender();
53248
53255
  }
53249
- if (!(item && item.getRichText())) {
53256
+ if (!text5) {
53250
53257
  this.textToEdit = undefined;
53251
53258
  return;
53252
53259
  }
53253
- const text5 = item.getRichText();
53254
- if (!text5) {
53260
+ if (this.textToEdit === text5) {
53255
53261
  return;
53256
53262
  }
53263
+ this.textToEdit = text5;
53257
53264
  if (text5.isEmpty()) {
53258
53265
  const textColor = tempStorage.getFontColor(item.itemType);
53259
53266
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -53287,7 +53294,6 @@ class BoardSelection {
53287
53294
  this.setVerticalAlignment(verticalAlignment);
53288
53295
  }
53289
53296
  }
53290
- this.textToEdit = text5;
53291
53297
  text5.editor.selectWholeText();
53292
53298
  this.textToEdit.disableRender();
53293
53299
  this.board.items.subject.publish(this.board.items);
package/dist/esm/index.js CHANGED
@@ -22234,8 +22234,14 @@ class RichText extends BaseItem {
22234
22234
  left = container.left;
22235
22235
  top = container.top;
22236
22236
  }
22237
+ const point3 = new Point(left, top);
22238
+ if (this.worldMatrixGetter) {
22239
+ this.worldMatrixGetter().apply(point3);
22240
+ } else {
22241
+ this.getParentWorldMatrix().apply(point3);
22242
+ }
22237
22243
  return {
22238
- point: new Point(left, top),
22244
+ point: point3,
22239
22245
  width,
22240
22246
  height,
22241
22247
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -40299,7 +40305,7 @@ class Sticker extends BaseItem {
40299
40305
  this.linkTo = new LinkTo(this.id, this.board.events);
40300
40306
  this.transformation = new Transformation(this.id, this.board.events);
40301
40307
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
40302
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
40308
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
40303
40309
  this.transformation.subject.subscribe((_subject, op) => {
40304
40310
  this.transformPath();
40305
40311
  if (op.method === "applyMatrix") {
@@ -53235,18 +53241,19 @@ class BoardSelection {
53235
53241
  }
53236
53242
  }
53237
53243
  setTextToEdit(item) {
53238
- if (this.textToEdit) {
53244
+ const text5 = item?.getRichText();
53245
+ if (this.textToEdit && this.textToEdit !== text5) {
53239
53246
  this.textToEdit.updateElement();
53240
53247
  this.textToEdit.enableRender();
53241
53248
  }
53242
- if (!(item && item.getRichText())) {
53249
+ if (!text5) {
53243
53250
  this.textToEdit = undefined;
53244
53251
  return;
53245
53252
  }
53246
- const text5 = item.getRichText();
53247
- if (!text5) {
53253
+ if (this.textToEdit === text5) {
53248
53254
  return;
53249
53255
  }
53256
+ this.textToEdit = text5;
53250
53257
  if (text5.isEmpty()) {
53251
53258
  const textColor = tempStorage.getFontColor(item.itemType);
53252
53259
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -53280,7 +53287,6 @@ class BoardSelection {
53280
53287
  this.setVerticalAlignment(verticalAlignment);
53281
53288
  }
53282
53289
  }
53283
- this.textToEdit = text5;
53284
53290
  text5.editor.selectWholeText();
53285
53291
  this.textToEdit.disableRender();
53286
53292
  this.board.items.subject.publish(this.board.items);
package/dist/esm/node.js CHANGED
@@ -24701,8 +24701,14 @@ class RichText extends BaseItem {
24701
24701
  left = container.left;
24702
24702
  top = container.top;
24703
24703
  }
24704
+ const point3 = new Point(left, top);
24705
+ if (this.worldMatrixGetter) {
24706
+ this.worldMatrixGetter().apply(point3);
24707
+ } else {
24708
+ this.getParentWorldMatrix().apply(point3);
24709
+ }
24704
24710
  return {
24705
- point: new Point(left, top),
24711
+ point: point3,
24706
24712
  width,
24707
24713
  height,
24708
24714
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -42767,7 +42773,7 @@ class Sticker extends BaseItem {
42767
42773
  this.linkTo = new LinkTo(this.id, this.board.events);
42768
42774
  this.transformation = new Transformation(this.id, this.board.events);
42769
42775
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
42770
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
42776
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
42771
42777
  this.transformation.subject.subscribe((_subject, op) => {
42772
42778
  this.transformPath();
42773
42779
  if (op.method === "applyMatrix") {
@@ -55703,18 +55709,19 @@ class BoardSelection {
55703
55709
  }
55704
55710
  }
55705
55711
  setTextToEdit(item) {
55706
- if (this.textToEdit) {
55712
+ const text5 = item?.getRichText();
55713
+ if (this.textToEdit && this.textToEdit !== text5) {
55707
55714
  this.textToEdit.updateElement();
55708
55715
  this.textToEdit.enableRender();
55709
55716
  }
55710
- if (!(item && item.getRichText())) {
55717
+ if (!text5) {
55711
55718
  this.textToEdit = undefined;
55712
55719
  return;
55713
55720
  }
55714
- const text5 = item.getRichText();
55715
- if (!text5) {
55721
+ if (this.textToEdit === text5) {
55716
55722
  return;
55717
55723
  }
55724
+ this.textToEdit = text5;
55718
55725
  if (text5.isEmpty()) {
55719
55726
  const textColor = tempStorage.getFontColor(item.itemType);
55720
55727
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -55748,7 +55755,6 @@ class BoardSelection {
55748
55755
  this.setVerticalAlignment(verticalAlignment);
55749
55756
  }
55750
55757
  }
55751
- this.textToEdit = text5;
55752
55758
  text5.editor.selectWholeText();
55753
55759
  this.textToEdit.disableRender();
55754
55760
  this.board.items.subject.publish(this.board.items);
@@ -73,7 +73,6 @@ export declare class RichText extends BaseItem {
73
73
  getTextWidth(): number;
74
74
  getMaxWidth(): number | undefined;
75
75
  getMaxHeight(): number | undefined;
76
- /** Get text dimensions for text editor */
77
76
  getDimensions(): {
78
77
  point: Point;
79
78
  width: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.11.7",
3
+ "version": "0.11.8",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",