microboard-temp 0.12.5 → 0.12.6
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 +4 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/node.js +4 -1
- package/dist/esm/browser.js +4 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/node.js +4 -1
- 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() {
|
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() {
|
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() {
|
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() {
|
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() {
|
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() {
|
|
@@ -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
|