microboard-temp 0.12.5 → 0.12.7
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/cjs/browser.js +11 -5
- package/dist/cjs/index.js +11 -5
- package/dist/cjs/node.js +11 -5
- package/dist/esm/browser.js +11 -5
- package/dist/esm/index.js +11 -5
- package/dist/esm/node.js +11 -5
- package/dist/types/Items/BaseItem/BaseItem.d.ts +5 -0
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -21809,6 +21809,7 @@ class BaseItem extends Mbr {
|
|
|
21809
21809
|
updateChildrenIds() {
|
|
21810
21810
|
this.children = this.index?.items.listAll().map((item) => item.getId()) || [];
|
|
21811
21811
|
}
|
|
21812
|
+
onParentChanged(_newParent) {}
|
|
21812
21813
|
getId() {
|
|
21813
21814
|
return this.id;
|
|
21814
21815
|
}
|
|
@@ -21944,6 +21945,7 @@ class BaseItem extends Mbr {
|
|
|
21944
21945
|
const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
|
|
21945
21946
|
this.board.items.index.remove(foundItem);
|
|
21946
21947
|
foundItem.parent = this.getId();
|
|
21948
|
+
foundItem.onParentChanged(this.getId());
|
|
21947
21949
|
foundItem.transformation.setLocalMatrix(localMatrix);
|
|
21948
21950
|
this.index?.insert(foundItem);
|
|
21949
21951
|
}
|
|
@@ -21965,6 +21967,7 @@ class BaseItem extends Mbr {
|
|
|
21965
21967
|
const worldMatrix = foundItem.transformation.toMatrix().composeWith(containerNestingMatrix);
|
|
21966
21968
|
this.index?.remove(foundItem);
|
|
21967
21969
|
foundItem.parent = "Board";
|
|
21970
|
+
foundItem.onParentChanged("Board");
|
|
21968
21971
|
foundItem.transformation.setLocalMatrix(worldMatrix);
|
|
21969
21972
|
this.board.items.index.insert(foundItem);
|
|
21970
21973
|
}
|
|
@@ -22437,7 +22440,7 @@ class RichText extends BaseItem {
|
|
|
22437
22440
|
height,
|
|
22438
22441
|
maxWidth: maxWidth ? maxWidth + 1 : undefined,
|
|
22439
22442
|
maxHeight,
|
|
22440
|
-
textScale: this.getScale()
|
|
22443
|
+
textScale: this.isInShape && !this.autoSize ? 1 : this.getScale()
|
|
22441
22444
|
};
|
|
22442
22445
|
}
|
|
22443
22446
|
transformCanvas() {
|
|
@@ -40470,7 +40473,7 @@ var stickerColors = {
|
|
|
40470
40473
|
var width = 200;
|
|
40471
40474
|
var height = 200;
|
|
40472
40475
|
var StickerShape = {
|
|
40473
|
-
textBounds: new Mbr(
|
|
40476
|
+
textBounds: new Mbr(8, 8, width - 8, height - 8),
|
|
40474
40477
|
stickerPath: new Path([
|
|
40475
40478
|
new Line(new Point(0, 0), new Point(width, 0)),
|
|
40476
40479
|
new Line(new Point(width, 0), new Point(width, height)),
|
|
@@ -40711,16 +40714,19 @@ class Sticker extends BaseItem {
|
|
|
40711
40714
|
div.style.boxShadow = "0px 18px 24px rgba(20, 21, 26, 0.25), 0px 8px 8px rgba(20, 21, 26, 0.125)";
|
|
40712
40715
|
const autoScale = this.text.isAutosize() && this.text.getAutoSizeScale() || 1;
|
|
40713
40716
|
const textElement = this.text.renderHTML(documentFactory);
|
|
40714
|
-
const padding =
|
|
40717
|
+
const padding = 8;
|
|
40715
40718
|
textElement.id = `${this.getId()}_text`;
|
|
40716
40719
|
textElement.style.overflow = "auto";
|
|
40717
40720
|
positionRelatively(textElement, div, padding);
|
|
40718
40721
|
resetElementScale(textElement);
|
|
40719
40722
|
scaleElementBy(textElement, 1 / scaleX, 1 / scaleY);
|
|
40720
40723
|
scaleElementBy(textElement, autoScale, autoScale);
|
|
40721
|
-
|
|
40724
|
+
const maxAvailableWidth = unscaledWidth - 2 * padding;
|
|
40725
|
+
textElement.style.maxWidth = `${maxAvailableWidth * scaleX}px`;
|
|
40722
40726
|
if (autoScale < 1) {
|
|
40723
|
-
textElement.style.width = `${
|
|
40727
|
+
textElement.style.width = `${maxAvailableWidth * scaleX}px`;
|
|
40728
|
+
} else {
|
|
40729
|
+
textElement.style.width = "100%";
|
|
40724
40730
|
}
|
|
40725
40731
|
const textHeight = this.text.layoutNodes.height * autoScale;
|
|
40726
40732
|
if (textHeight < height2) {
|
package/dist/cjs/index.js
CHANGED
|
@@ -21809,6 +21809,7 @@ class BaseItem extends Mbr {
|
|
|
21809
21809
|
updateChildrenIds() {
|
|
21810
21810
|
this.children = this.index?.items.listAll().map((item) => item.getId()) || [];
|
|
21811
21811
|
}
|
|
21812
|
+
onParentChanged(_newParent) {}
|
|
21812
21813
|
getId() {
|
|
21813
21814
|
return this.id;
|
|
21814
21815
|
}
|
|
@@ -21944,6 +21945,7 @@ class BaseItem extends Mbr {
|
|
|
21944
21945
|
const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
|
|
21945
21946
|
this.board.items.index.remove(foundItem);
|
|
21946
21947
|
foundItem.parent = this.getId();
|
|
21948
|
+
foundItem.onParentChanged(this.getId());
|
|
21947
21949
|
foundItem.transformation.setLocalMatrix(localMatrix);
|
|
21948
21950
|
this.index?.insert(foundItem);
|
|
21949
21951
|
}
|
|
@@ -21965,6 +21967,7 @@ class BaseItem extends Mbr {
|
|
|
21965
21967
|
const worldMatrix = foundItem.transformation.toMatrix().composeWith(containerNestingMatrix);
|
|
21966
21968
|
this.index?.remove(foundItem);
|
|
21967
21969
|
foundItem.parent = "Board";
|
|
21970
|
+
foundItem.onParentChanged("Board");
|
|
21968
21971
|
foundItem.transformation.setLocalMatrix(worldMatrix);
|
|
21969
21972
|
this.board.items.index.insert(foundItem);
|
|
21970
21973
|
}
|
|
@@ -22437,7 +22440,7 @@ class RichText extends BaseItem {
|
|
|
22437
22440
|
height,
|
|
22438
22441
|
maxWidth: maxWidth ? maxWidth + 1 : undefined,
|
|
22439
22442
|
maxHeight,
|
|
22440
|
-
textScale: this.getScale()
|
|
22443
|
+
textScale: this.isInShape && !this.autoSize ? 1 : this.getScale()
|
|
22441
22444
|
};
|
|
22442
22445
|
}
|
|
22443
22446
|
transformCanvas() {
|
|
@@ -40470,7 +40473,7 @@ var stickerColors = {
|
|
|
40470
40473
|
var width = 200;
|
|
40471
40474
|
var height = 200;
|
|
40472
40475
|
var StickerShape = {
|
|
40473
|
-
textBounds: new Mbr(
|
|
40476
|
+
textBounds: new Mbr(8, 8, width - 8, height - 8),
|
|
40474
40477
|
stickerPath: new Path([
|
|
40475
40478
|
new Line(new Point(0, 0), new Point(width, 0)),
|
|
40476
40479
|
new Line(new Point(width, 0), new Point(width, height)),
|
|
@@ -40711,16 +40714,19 @@ class Sticker extends BaseItem {
|
|
|
40711
40714
|
div.style.boxShadow = "0px 18px 24px rgba(20, 21, 26, 0.25), 0px 8px 8px rgba(20, 21, 26, 0.125)";
|
|
40712
40715
|
const autoScale = this.text.isAutosize() && this.text.getAutoSizeScale() || 1;
|
|
40713
40716
|
const textElement = this.text.renderHTML(documentFactory);
|
|
40714
|
-
const padding =
|
|
40717
|
+
const padding = 8;
|
|
40715
40718
|
textElement.id = `${this.getId()}_text`;
|
|
40716
40719
|
textElement.style.overflow = "auto";
|
|
40717
40720
|
positionRelatively(textElement, div, padding);
|
|
40718
40721
|
resetElementScale(textElement);
|
|
40719
40722
|
scaleElementBy(textElement, 1 / scaleX, 1 / scaleY);
|
|
40720
40723
|
scaleElementBy(textElement, autoScale, autoScale);
|
|
40721
|
-
|
|
40724
|
+
const maxAvailableWidth = unscaledWidth - 2 * padding;
|
|
40725
|
+
textElement.style.maxWidth = `${maxAvailableWidth * scaleX}px`;
|
|
40722
40726
|
if (autoScale < 1) {
|
|
40723
|
-
textElement.style.width = `${
|
|
40727
|
+
textElement.style.width = `${maxAvailableWidth * scaleX}px`;
|
|
40728
|
+
} else {
|
|
40729
|
+
textElement.style.width = "100%";
|
|
40724
40730
|
}
|
|
40725
40731
|
const textHeight = this.text.layoutNodes.height * autoScale;
|
|
40726
40732
|
if (textHeight < height2) {
|
package/dist/cjs/node.js
CHANGED
|
@@ -24281,6 +24281,7 @@ class BaseItem extends Mbr {
|
|
|
24281
24281
|
updateChildrenIds() {
|
|
24282
24282
|
this.children = this.index?.items.listAll().map((item) => item.getId()) || [];
|
|
24283
24283
|
}
|
|
24284
|
+
onParentChanged(_newParent) {}
|
|
24284
24285
|
getId() {
|
|
24285
24286
|
return this.id;
|
|
24286
24287
|
}
|
|
@@ -24416,6 +24417,7 @@ class BaseItem extends Mbr {
|
|
|
24416
24417
|
const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
|
|
24417
24418
|
this.board.items.index.remove(foundItem);
|
|
24418
24419
|
foundItem.parent = this.getId();
|
|
24420
|
+
foundItem.onParentChanged(this.getId());
|
|
24419
24421
|
foundItem.transformation.setLocalMatrix(localMatrix);
|
|
24420
24422
|
this.index?.insert(foundItem);
|
|
24421
24423
|
}
|
|
@@ -24437,6 +24439,7 @@ class BaseItem extends Mbr {
|
|
|
24437
24439
|
const worldMatrix = foundItem.transformation.toMatrix().composeWith(containerNestingMatrix);
|
|
24438
24440
|
this.index?.remove(foundItem);
|
|
24439
24441
|
foundItem.parent = "Board";
|
|
24442
|
+
foundItem.onParentChanged("Board");
|
|
24440
24443
|
foundItem.transformation.setLocalMatrix(worldMatrix);
|
|
24441
24444
|
this.board.items.index.insert(foundItem);
|
|
24442
24445
|
}
|
|
@@ -24909,7 +24912,7 @@ class RichText extends BaseItem {
|
|
|
24909
24912
|
height,
|
|
24910
24913
|
maxWidth: maxWidth ? maxWidth + 1 : undefined,
|
|
24911
24914
|
maxHeight,
|
|
24912
|
-
textScale: this.getScale()
|
|
24915
|
+
textScale: this.isInShape && !this.autoSize ? 1 : this.getScale()
|
|
24913
24916
|
};
|
|
24914
24917
|
}
|
|
24915
24918
|
transformCanvas() {
|
|
@@ -42943,7 +42946,7 @@ var stickerColors = {
|
|
|
42943
42946
|
var width = 200;
|
|
42944
42947
|
var height = 200;
|
|
42945
42948
|
var StickerShape = {
|
|
42946
|
-
textBounds: new Mbr(
|
|
42949
|
+
textBounds: new Mbr(8, 8, width - 8, height - 8),
|
|
42947
42950
|
stickerPath: new Path([
|
|
42948
42951
|
new Line(new Point(0, 0), new Point(width, 0)),
|
|
42949
42952
|
new Line(new Point(width, 0), new Point(width, height)),
|
|
@@ -43184,16 +43187,19 @@ class Sticker extends BaseItem {
|
|
|
43184
43187
|
div.style.boxShadow = "0px 18px 24px rgba(20, 21, 26, 0.25), 0px 8px 8px rgba(20, 21, 26, 0.125)";
|
|
43185
43188
|
const autoScale = this.text.isAutosize() && this.text.getAutoSizeScale() || 1;
|
|
43186
43189
|
const textElement = this.text.renderHTML(documentFactory);
|
|
43187
|
-
const padding =
|
|
43190
|
+
const padding = 8;
|
|
43188
43191
|
textElement.id = `${this.getId()}_text`;
|
|
43189
43192
|
textElement.style.overflow = "auto";
|
|
43190
43193
|
positionRelatively(textElement, div, padding);
|
|
43191
43194
|
resetElementScale(textElement);
|
|
43192
43195
|
scaleElementBy(textElement, 1 / scaleX, 1 / scaleY);
|
|
43193
43196
|
scaleElementBy(textElement, autoScale, autoScale);
|
|
43194
|
-
|
|
43197
|
+
const maxAvailableWidth = unscaledWidth - 2 * padding;
|
|
43198
|
+
textElement.style.maxWidth = `${maxAvailableWidth * scaleX}px`;
|
|
43195
43199
|
if (autoScale < 1) {
|
|
43196
|
-
textElement.style.width = `${
|
|
43200
|
+
textElement.style.width = `${maxAvailableWidth * scaleX}px`;
|
|
43201
|
+
} else {
|
|
43202
|
+
textElement.style.width = "100%";
|
|
43197
43203
|
}
|
|
43198
43204
|
const textHeight = this.text.layoutNodes.height * autoScale;
|
|
43199
43205
|
if (textHeight < height2) {
|
package/dist/esm/browser.js
CHANGED
|
@@ -21638,6 +21638,7 @@ class BaseItem extends Mbr {
|
|
|
21638
21638
|
updateChildrenIds() {
|
|
21639
21639
|
this.children = this.index?.items.listAll().map((item) => item.getId()) || [];
|
|
21640
21640
|
}
|
|
21641
|
+
onParentChanged(_newParent) {}
|
|
21641
21642
|
getId() {
|
|
21642
21643
|
return this.id;
|
|
21643
21644
|
}
|
|
@@ -21773,6 +21774,7 @@ class BaseItem extends Mbr {
|
|
|
21773
21774
|
const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
|
|
21774
21775
|
this.board.items.index.remove(foundItem);
|
|
21775
21776
|
foundItem.parent = this.getId();
|
|
21777
|
+
foundItem.onParentChanged(this.getId());
|
|
21776
21778
|
foundItem.transformation.setLocalMatrix(localMatrix);
|
|
21777
21779
|
this.index?.insert(foundItem);
|
|
21778
21780
|
}
|
|
@@ -21794,6 +21796,7 @@ class BaseItem extends Mbr {
|
|
|
21794
21796
|
const worldMatrix = foundItem.transformation.toMatrix().composeWith(containerNestingMatrix);
|
|
21795
21797
|
this.index?.remove(foundItem);
|
|
21796
21798
|
foundItem.parent = "Board";
|
|
21799
|
+
foundItem.onParentChanged("Board");
|
|
21797
21800
|
foundItem.transformation.setLocalMatrix(worldMatrix);
|
|
21798
21801
|
this.board.items.index.insert(foundItem);
|
|
21799
21802
|
}
|
|
@@ -22266,7 +22269,7 @@ class RichText extends BaseItem {
|
|
|
22266
22269
|
height,
|
|
22267
22270
|
maxWidth: maxWidth ? maxWidth + 1 : undefined,
|
|
22268
22271
|
maxHeight,
|
|
22269
|
-
textScale: this.getScale()
|
|
22272
|
+
textScale: this.isInShape && !this.autoSize ? 1 : this.getScale()
|
|
22270
22273
|
};
|
|
22271
22274
|
}
|
|
22272
22275
|
transformCanvas() {
|
|
@@ -40299,7 +40302,7 @@ var stickerColors = {
|
|
|
40299
40302
|
var width = 200;
|
|
40300
40303
|
var height = 200;
|
|
40301
40304
|
var StickerShape = {
|
|
40302
|
-
textBounds: new Mbr(
|
|
40305
|
+
textBounds: new Mbr(8, 8, width - 8, height - 8),
|
|
40303
40306
|
stickerPath: new Path([
|
|
40304
40307
|
new Line(new Point(0, 0), new Point(width, 0)),
|
|
40305
40308
|
new Line(new Point(width, 0), new Point(width, height)),
|
|
@@ -40540,16 +40543,19 @@ class Sticker extends BaseItem {
|
|
|
40540
40543
|
div.style.boxShadow = "0px 18px 24px rgba(20, 21, 26, 0.25), 0px 8px 8px rgba(20, 21, 26, 0.125)";
|
|
40541
40544
|
const autoScale = this.text.isAutosize() && this.text.getAutoSizeScale() || 1;
|
|
40542
40545
|
const textElement = this.text.renderHTML(documentFactory);
|
|
40543
|
-
const padding =
|
|
40546
|
+
const padding = 8;
|
|
40544
40547
|
textElement.id = `${this.getId()}_text`;
|
|
40545
40548
|
textElement.style.overflow = "auto";
|
|
40546
40549
|
positionRelatively(textElement, div, padding);
|
|
40547
40550
|
resetElementScale(textElement);
|
|
40548
40551
|
scaleElementBy(textElement, 1 / scaleX, 1 / scaleY);
|
|
40549
40552
|
scaleElementBy(textElement, autoScale, autoScale);
|
|
40550
|
-
|
|
40553
|
+
const maxAvailableWidth = unscaledWidth - 2 * padding;
|
|
40554
|
+
textElement.style.maxWidth = `${maxAvailableWidth * scaleX}px`;
|
|
40551
40555
|
if (autoScale < 1) {
|
|
40552
|
-
textElement.style.width = `${
|
|
40556
|
+
textElement.style.width = `${maxAvailableWidth * scaleX}px`;
|
|
40557
|
+
} else {
|
|
40558
|
+
textElement.style.width = "100%";
|
|
40553
40559
|
}
|
|
40554
40560
|
const textHeight = this.text.layoutNodes.height * autoScale;
|
|
40555
40561
|
if (textHeight < height2) {
|
package/dist/esm/index.js
CHANGED
|
@@ -21631,6 +21631,7 @@ class BaseItem extends Mbr {
|
|
|
21631
21631
|
updateChildrenIds() {
|
|
21632
21632
|
this.children = this.index?.items.listAll().map((item) => item.getId()) || [];
|
|
21633
21633
|
}
|
|
21634
|
+
onParentChanged(_newParent) {}
|
|
21634
21635
|
getId() {
|
|
21635
21636
|
return this.id;
|
|
21636
21637
|
}
|
|
@@ -21766,6 +21767,7 @@ class BaseItem extends Mbr {
|
|
|
21766
21767
|
const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
|
|
21767
21768
|
this.board.items.index.remove(foundItem);
|
|
21768
21769
|
foundItem.parent = this.getId();
|
|
21770
|
+
foundItem.onParentChanged(this.getId());
|
|
21769
21771
|
foundItem.transformation.setLocalMatrix(localMatrix);
|
|
21770
21772
|
this.index?.insert(foundItem);
|
|
21771
21773
|
}
|
|
@@ -21787,6 +21789,7 @@ class BaseItem extends Mbr {
|
|
|
21787
21789
|
const worldMatrix = foundItem.transformation.toMatrix().composeWith(containerNestingMatrix);
|
|
21788
21790
|
this.index?.remove(foundItem);
|
|
21789
21791
|
foundItem.parent = "Board";
|
|
21792
|
+
foundItem.onParentChanged("Board");
|
|
21790
21793
|
foundItem.transformation.setLocalMatrix(worldMatrix);
|
|
21791
21794
|
this.board.items.index.insert(foundItem);
|
|
21792
21795
|
}
|
|
@@ -22259,7 +22262,7 @@ class RichText extends BaseItem {
|
|
|
22259
22262
|
height,
|
|
22260
22263
|
maxWidth: maxWidth ? maxWidth + 1 : undefined,
|
|
22261
22264
|
maxHeight,
|
|
22262
|
-
textScale: this.getScale()
|
|
22265
|
+
textScale: this.isInShape && !this.autoSize ? 1 : this.getScale()
|
|
22263
22266
|
};
|
|
22264
22267
|
}
|
|
22265
22268
|
transformCanvas() {
|
|
@@ -40292,7 +40295,7 @@ var stickerColors = {
|
|
|
40292
40295
|
var width = 200;
|
|
40293
40296
|
var height = 200;
|
|
40294
40297
|
var StickerShape = {
|
|
40295
|
-
textBounds: new Mbr(
|
|
40298
|
+
textBounds: new Mbr(8, 8, width - 8, height - 8),
|
|
40296
40299
|
stickerPath: new Path([
|
|
40297
40300
|
new Line(new Point(0, 0), new Point(width, 0)),
|
|
40298
40301
|
new Line(new Point(width, 0), new Point(width, height)),
|
|
@@ -40533,16 +40536,19 @@ class Sticker extends BaseItem {
|
|
|
40533
40536
|
div.style.boxShadow = "0px 18px 24px rgba(20, 21, 26, 0.25), 0px 8px 8px rgba(20, 21, 26, 0.125)";
|
|
40534
40537
|
const autoScale = this.text.isAutosize() && this.text.getAutoSizeScale() || 1;
|
|
40535
40538
|
const textElement = this.text.renderHTML(documentFactory);
|
|
40536
|
-
const padding =
|
|
40539
|
+
const padding = 8;
|
|
40537
40540
|
textElement.id = `${this.getId()}_text`;
|
|
40538
40541
|
textElement.style.overflow = "auto";
|
|
40539
40542
|
positionRelatively(textElement, div, padding);
|
|
40540
40543
|
resetElementScale(textElement);
|
|
40541
40544
|
scaleElementBy(textElement, 1 / scaleX, 1 / scaleY);
|
|
40542
40545
|
scaleElementBy(textElement, autoScale, autoScale);
|
|
40543
|
-
|
|
40546
|
+
const maxAvailableWidth = unscaledWidth - 2 * padding;
|
|
40547
|
+
textElement.style.maxWidth = `${maxAvailableWidth * scaleX}px`;
|
|
40544
40548
|
if (autoScale < 1) {
|
|
40545
|
-
textElement.style.width = `${
|
|
40549
|
+
textElement.style.width = `${maxAvailableWidth * scaleX}px`;
|
|
40550
|
+
} else {
|
|
40551
|
+
textElement.style.width = "100%";
|
|
40546
40552
|
}
|
|
40547
40553
|
const textHeight = this.text.layoutNodes.height * autoScale;
|
|
40548
40554
|
if (textHeight < height2) {
|
package/dist/esm/node.js
CHANGED
|
@@ -24098,6 +24098,7 @@ class BaseItem extends Mbr {
|
|
|
24098
24098
|
updateChildrenIds() {
|
|
24099
24099
|
this.children = this.index?.items.listAll().map((item) => item.getId()) || [];
|
|
24100
24100
|
}
|
|
24101
|
+
onParentChanged(_newParent) {}
|
|
24101
24102
|
getId() {
|
|
24102
24103
|
return this.id;
|
|
24103
24104
|
}
|
|
@@ -24233,6 +24234,7 @@ class BaseItem extends Mbr {
|
|
|
24233
24234
|
const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
|
|
24234
24235
|
this.board.items.index.remove(foundItem);
|
|
24235
24236
|
foundItem.parent = this.getId();
|
|
24237
|
+
foundItem.onParentChanged(this.getId());
|
|
24236
24238
|
foundItem.transformation.setLocalMatrix(localMatrix);
|
|
24237
24239
|
this.index?.insert(foundItem);
|
|
24238
24240
|
}
|
|
@@ -24254,6 +24256,7 @@ class BaseItem extends Mbr {
|
|
|
24254
24256
|
const worldMatrix = foundItem.transformation.toMatrix().composeWith(containerNestingMatrix);
|
|
24255
24257
|
this.index?.remove(foundItem);
|
|
24256
24258
|
foundItem.parent = "Board";
|
|
24259
|
+
foundItem.onParentChanged("Board");
|
|
24257
24260
|
foundItem.transformation.setLocalMatrix(worldMatrix);
|
|
24258
24261
|
this.board.items.index.insert(foundItem);
|
|
24259
24262
|
}
|
|
@@ -24726,7 +24729,7 @@ class RichText extends BaseItem {
|
|
|
24726
24729
|
height,
|
|
24727
24730
|
maxWidth: maxWidth ? maxWidth + 1 : undefined,
|
|
24728
24731
|
maxHeight,
|
|
24729
|
-
textScale: this.getScale()
|
|
24732
|
+
textScale: this.isInShape && !this.autoSize ? 1 : this.getScale()
|
|
24730
24733
|
};
|
|
24731
24734
|
}
|
|
24732
24735
|
transformCanvas() {
|
|
@@ -42760,7 +42763,7 @@ var stickerColors = {
|
|
|
42760
42763
|
var width = 200;
|
|
42761
42764
|
var height = 200;
|
|
42762
42765
|
var StickerShape = {
|
|
42763
|
-
textBounds: new Mbr(
|
|
42766
|
+
textBounds: new Mbr(8, 8, width - 8, height - 8),
|
|
42764
42767
|
stickerPath: new Path([
|
|
42765
42768
|
new Line(new Point(0, 0), new Point(width, 0)),
|
|
42766
42769
|
new Line(new Point(width, 0), new Point(width, height)),
|
|
@@ -43001,16 +43004,19 @@ class Sticker extends BaseItem {
|
|
|
43001
43004
|
div.style.boxShadow = "0px 18px 24px rgba(20, 21, 26, 0.25), 0px 8px 8px rgba(20, 21, 26, 0.125)";
|
|
43002
43005
|
const autoScale = this.text.isAutosize() && this.text.getAutoSizeScale() || 1;
|
|
43003
43006
|
const textElement = this.text.renderHTML(documentFactory);
|
|
43004
|
-
const padding =
|
|
43007
|
+
const padding = 8;
|
|
43005
43008
|
textElement.id = `${this.getId()}_text`;
|
|
43006
43009
|
textElement.style.overflow = "auto";
|
|
43007
43010
|
positionRelatively(textElement, div, padding);
|
|
43008
43011
|
resetElementScale(textElement);
|
|
43009
43012
|
scaleElementBy(textElement, 1 / scaleX, 1 / scaleY);
|
|
43010
43013
|
scaleElementBy(textElement, autoScale, autoScale);
|
|
43011
|
-
|
|
43014
|
+
const maxAvailableWidth = unscaledWidth - 2 * padding;
|
|
43015
|
+
textElement.style.maxWidth = `${maxAvailableWidth * scaleX}px`;
|
|
43012
43016
|
if (autoScale < 1) {
|
|
43013
|
-
textElement.style.width = `${
|
|
43017
|
+
textElement.style.width = `${maxAvailableWidth * scaleX}px`;
|
|
43018
|
+
} else {
|
|
43019
|
+
textElement.style.width = "100%";
|
|
43014
43020
|
}
|
|
43015
43021
|
const textHeight = this.text.layoutNodes.height * autoScale;
|
|
43016
43022
|
if (textHeight < height2) {
|
|
@@ -47,6 +47,11 @@ export declare class BaseItem extends Mbr implements Geometry {
|
|
|
47
47
|
static readonly HOVER_HIGHLIGHT_COLOR = "rgba(71, 120, 245, 0.7)";
|
|
48
48
|
constructor(board: Board, id?: string, defaultItemData?: BaseItemData | undefined, isGroupItem?: boolean);
|
|
49
49
|
updateChildrenIds(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Called when this item's parent changes. Subclasses override this to
|
|
52
|
+
* propagate the new parent to child objects (e.g. text.parent in Sticker/Shape).
|
|
53
|
+
*/
|
|
54
|
+
protected onParentChanged(_newParent: string): void;
|
|
50
55
|
getId(): string;
|
|
51
56
|
/**
|
|
52
57
|
* Returns the parent's world matrix. For Frames, only the translation component
|