microboard-temp 0.13.31 → 0.13.32
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 +54 -39
- package/dist/cjs/index.js +54 -39
- package/dist/cjs/node.js +54 -39
- package/dist/esm/browser.js +54 -39
- package/dist/esm/index.js +54 -39
- package/dist/esm/node.js +54 -39
- package/dist/types/Items/BaseItem/BaseItem.d.ts +1 -0
- package/dist/types/Items/RichText/RichTextOperations.d.ts +1 -1
- package/dist/types/Selection/Selection.d.ts +1 -0
- package/dist/types/SessionStorage.d.ts +2 -2
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -7455,11 +7455,11 @@ class SessionStorage {
|
|
|
7455
7455
|
getFontHighlight(itemType) {
|
|
7456
7456
|
return this.get(`fontHighlightColor_${itemType}`);
|
|
7457
7457
|
}
|
|
7458
|
-
|
|
7459
|
-
this.set(`
|
|
7458
|
+
setHorisontalAlignment(itemType, horisontalAlignment) {
|
|
7459
|
+
this.set(`fontHorisontalAlignment_${itemType}`, horisontalAlignment);
|
|
7460
7460
|
}
|
|
7461
|
-
|
|
7462
|
-
return this.get(`
|
|
7461
|
+
getHorisontalAlignment(itemType) {
|
|
7462
|
+
return this.get(`fontHorisontalAlignment_${itemType}`);
|
|
7463
7463
|
}
|
|
7464
7464
|
setVerticalAlignment(itemType, verticalAlignment) {
|
|
7465
7465
|
this.set(`fontVerticalAlignment_${itemType}`, verticalAlignment);
|
|
@@ -17389,7 +17389,7 @@ class EditorContainer {
|
|
|
17389
17389
|
break;
|
|
17390
17390
|
case "setSelectionFontHighlight":
|
|
17391
17391
|
case "setSelectionFontStyle":
|
|
17392
|
-
case "
|
|
17392
|
+
case "setSelectionHorisontalAlignment":
|
|
17393
17393
|
this.applySelectionOp(op);
|
|
17394
17394
|
break;
|
|
17395
17395
|
case "setFontStyle":
|
|
@@ -21451,10 +21451,6 @@ class Items {
|
|
|
21451
21451
|
const unmodifiedSize = size;
|
|
21452
21452
|
size = 16;
|
|
21453
21453
|
const tolerated = this.index.getEnclosedOrCrossed(x - size, y - size, x + size, y + size);
|
|
21454
|
-
const groups = tolerated.filter((item) => item.itemType === "Group");
|
|
21455
|
-
if (groups.length > 0) {
|
|
21456
|
-
return groups;
|
|
21457
|
-
}
|
|
21458
21454
|
let enclosed = tolerated.some((item) => item instanceof Connector2) ? tolerated : this.index.getEnclosedOrCrossed(x, y, x, y);
|
|
21459
21455
|
const underPointer = this.getUnderPoint(new Point(x, y), size);
|
|
21460
21456
|
if (enclosed.length === 0) {
|
|
@@ -21994,6 +21990,20 @@ class BaseItem extends Mbr {
|
|
|
21994
21990
|
parentMatrix.apply(c);
|
|
21995
21991
|
return new Mbr(Math.min(corners[0].x, corners[1].x, corners[2].x, corners[3].x), Math.min(corners[0].y, corners[1].y, corners[2].y, corners[3].y), Math.max(corners[0].x, corners[1].x, corners[2].x, corners[3].x), Math.max(corners[0].y, corners[1].y, corners[2].y, corners[3].y));
|
|
21996
21992
|
}
|
|
21993
|
+
hasAncestor(itemId) {
|
|
21994
|
+
let parentId = this.parent;
|
|
21995
|
+
while (parentId && parentId !== "Board") {
|
|
21996
|
+
if (parentId === itemId) {
|
|
21997
|
+
return true;
|
|
21998
|
+
}
|
|
21999
|
+
const parent = this.board.items.getById(parentId);
|
|
22000
|
+
if (!parent || parent.parent === parentId) {
|
|
22001
|
+
break;
|
|
22002
|
+
}
|
|
22003
|
+
parentId = parent.parent;
|
|
22004
|
+
}
|
|
22005
|
+
return false;
|
|
22006
|
+
}
|
|
21997
22007
|
applyAddChildren(childIds) {
|
|
21998
22008
|
if (!this.index) {
|
|
21999
22009
|
return;
|
|
@@ -22001,7 +22011,7 @@ class BaseItem extends Mbr {
|
|
|
22001
22011
|
const containerNestingMatrix = this.getNestingMatrix();
|
|
22002
22012
|
childIds.forEach((childId) => {
|
|
22003
22013
|
const foundItem = this.board.items.getById(childId);
|
|
22004
|
-
if (this.parent !== childId && this.getId() !== childId) {
|
|
22014
|
+
if (this.parent !== childId && this.getId() !== childId && !this.hasAncestor(childId)) {
|
|
22005
22015
|
if (!this.index?.getById(childId) && foundItem) {
|
|
22006
22016
|
const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
|
|
22007
22017
|
this.board.items.index.remove(foundItem);
|
|
@@ -22496,12 +22506,14 @@ class RichText extends BaseItem {
|
|
|
22496
22506
|
top = container.top;
|
|
22497
22507
|
}
|
|
22498
22508
|
const point3 = new Point(left, top);
|
|
22499
|
-
this.
|
|
22509
|
+
if (!this.isInShape || this.autoSize) {
|
|
22510
|
+
this.getParentWorldMatrix().apply(point3);
|
|
22511
|
+
}
|
|
22500
22512
|
return {
|
|
22501
22513
|
point: point3,
|
|
22502
22514
|
width,
|
|
22503
22515
|
height,
|
|
22504
|
-
maxWidth: maxWidth ? maxWidth
|
|
22516
|
+
maxWidth: maxWidth ? maxWidth : undefined,
|
|
22505
22517
|
maxHeight,
|
|
22506
22518
|
textScale: this.isInShape && !this.autoSize ? 1 : this.getScale()
|
|
22507
22519
|
};
|
|
@@ -40189,6 +40201,7 @@ class Shape extends BaseItem {
|
|
|
40189
40201
|
this.text.deserialize(data.text);
|
|
40190
40202
|
}
|
|
40191
40203
|
this.transformPath();
|
|
40204
|
+
this.text.updateElement();
|
|
40192
40205
|
this.subject.publish(this);
|
|
40193
40206
|
return this;
|
|
40194
40207
|
}
|
|
@@ -43686,6 +43699,7 @@ class Group extends BaseItem {
|
|
|
43686
43699
|
constructor(board, events, children = [], id = "") {
|
|
43687
43700
|
super(board, id, undefined, true);
|
|
43688
43701
|
this.events = events;
|
|
43702
|
+
this.canBeNested = true;
|
|
43689
43703
|
this.linkTo = new LinkTo(this.id, this.events);
|
|
43690
43704
|
this.transformation = new Transformation(this.id, this.events);
|
|
43691
43705
|
this.transformation.subject.subscribe(() => {
|
|
@@ -47114,7 +47128,8 @@ class Select extends Tool {
|
|
|
47114
47128
|
this.beginTimeStamp = Date.now();
|
|
47115
47129
|
const selectionMbr = selection.getMbr();
|
|
47116
47130
|
const selectionItems = selection.list();
|
|
47117
|
-
|
|
47131
|
+
const selectableHover = hover.map((item) => this.board.selection.getSelectableItem(item));
|
|
47132
|
+
this.isDownOnSelection = selectionMbr !== undefined && selectionMbr.isUnderPoint(pointer.point) && selectableHover.every((hovered) => hovered && selectionItems.some((selected) => selected.getId() === hovered.getId()));
|
|
47118
47133
|
this.isDraggingSelection = this.isDownOnSelection;
|
|
47119
47134
|
if (this.isDraggingSelection) {
|
|
47120
47135
|
this.board.selection.transformationRenderBlock = true;
|
|
@@ -47440,7 +47455,7 @@ class Select extends Tool {
|
|
|
47440
47455
|
const hovered = this.board.items.getUnderPointer();
|
|
47441
47456
|
this.board.pointer.subject.publish(this.board.pointer);
|
|
47442
47457
|
if (isCtrl || isShift) {
|
|
47443
|
-
const underPointer = hovered[0];
|
|
47458
|
+
const underPointer = this.board.selection.getSelectableItem(hovered[0]);
|
|
47444
47459
|
const isEmptySelection = this.board.selection.items.list().length === 0;
|
|
47445
47460
|
if (!underPointer && !isEmptySelection && isShift) {
|
|
47446
47461
|
this.board.selection.add(this.board.selection.items.list());
|
|
@@ -47456,14 +47471,6 @@ class Select extends Tool {
|
|
|
47456
47471
|
const isNotInSelection = this.board.selection.items.findById(underPointer.getId()) === null;
|
|
47457
47472
|
if (isNotInSelection) {
|
|
47458
47473
|
this.board.selection.add(underPointer);
|
|
47459
|
-
if ("index" in underPointer && underPointer.index) {
|
|
47460
|
-
const { left, right, top, bottom } = underPointer.getMbr();
|
|
47461
|
-
const childrenIds = underPointer.getChildrenIds();
|
|
47462
|
-
console.log("UNDERPOINTER", underPointer);
|
|
47463
|
-
console.log("CHILDREN", childrenIds);
|
|
47464
|
-
const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => childrenIds && childrenIds.includes(item.getId()));
|
|
47465
|
-
this.board.selection.add(itemsInFrame);
|
|
47466
|
-
}
|
|
47467
47474
|
this.board.selection.setContext("EditUnderPointer");
|
|
47468
47475
|
} else {
|
|
47469
47476
|
this.board.selection.remove(underPointer);
|
|
@@ -47480,10 +47487,6 @@ class Select extends Tool {
|
|
|
47480
47487
|
} else {
|
|
47481
47488
|
this.board.selection.editUnderPointer();
|
|
47482
47489
|
}
|
|
47483
|
-
if (topItem2 instanceof Group) {
|
|
47484
|
-
const groupChildren = topItem2.getChildren();
|
|
47485
|
-
this.board.selection.add(groupChildren);
|
|
47486
|
-
}
|
|
47487
47490
|
this.board.tools.publish();
|
|
47488
47491
|
this.clear();
|
|
47489
47492
|
return false;
|
|
@@ -53519,10 +53522,23 @@ class BoardSelection {
|
|
|
53519
53522
|
getMbr() {
|
|
53520
53523
|
return this.items.getMbr();
|
|
53521
53524
|
}
|
|
53525
|
+
getSelectableItem(item) {
|
|
53526
|
+
if (!item) {
|
|
53527
|
+
return null;
|
|
53528
|
+
}
|
|
53529
|
+
if (!(item instanceof BaseItem) || item.parent === "Board") {
|
|
53530
|
+
return item;
|
|
53531
|
+
}
|
|
53532
|
+
const parent = this.board.items.getById(item.parent);
|
|
53533
|
+
if (parent instanceof Group) {
|
|
53534
|
+
return parent;
|
|
53535
|
+
}
|
|
53536
|
+
return item;
|
|
53537
|
+
}
|
|
53522
53538
|
selectUnderPointer() {
|
|
53523
53539
|
this.removeAll();
|
|
53524
53540
|
const stack = this.board.items.getUnderPointer();
|
|
53525
|
-
const top = stack.pop();
|
|
53541
|
+
const top = this.getSelectableItem(stack.pop());
|
|
53526
53542
|
if (top) {
|
|
53527
53543
|
this.add(top);
|
|
53528
53544
|
this.setTextToEdit(undefined);
|
|
@@ -53576,7 +53592,7 @@ class BoardSelection {
|
|
|
53576
53592
|
editUnderPointer() {
|
|
53577
53593
|
this.removeAll();
|
|
53578
53594
|
const stack = this.board.items.getUnderPointer();
|
|
53579
|
-
const item = stack.pop();
|
|
53595
|
+
const item = this.getSelectableItem(stack.pop());
|
|
53580
53596
|
if (item) {
|
|
53581
53597
|
this.add(item);
|
|
53582
53598
|
this.setTextToEdit(undefined);
|
|
@@ -53610,7 +53626,7 @@ class BoardSelection {
|
|
|
53610
53626
|
const textSize = tempStorage.getFontSize(item.itemType);
|
|
53611
53627
|
const highlightColor = tempStorage.getFontHighlight(item.itemType);
|
|
53612
53628
|
const styles = tempStorage.getFontStyles(item.itemType);
|
|
53613
|
-
const
|
|
53629
|
+
const horisontalAlignment = tempStorage.getHorisontalAlignment(item.itemType);
|
|
53614
53630
|
const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
|
|
53615
53631
|
if (textColor) {
|
|
53616
53632
|
text5.setSelectionFontColor(textColor, "None");
|
|
@@ -53631,8 +53647,8 @@ class BoardSelection {
|
|
|
53631
53647
|
const stylesArr = styles;
|
|
53632
53648
|
text5.setSelectionFontStyle(stylesArr, "None");
|
|
53633
53649
|
}
|
|
53634
|
-
if (
|
|
53635
|
-
text5.setSelectionHorisontalAlignment(
|
|
53650
|
+
if (horisontalAlignment && !(item instanceof Sticker)) {
|
|
53651
|
+
text5.setSelectionHorisontalAlignment(horisontalAlignment);
|
|
53636
53652
|
}
|
|
53637
53653
|
if (verticalAlignment && !(item instanceof Sticker)) {
|
|
53638
53654
|
this.setVerticalAlignment(verticalAlignment);
|
|
@@ -53645,7 +53661,7 @@ class BoardSelection {
|
|
|
53645
53661
|
editTextUnderPointer() {
|
|
53646
53662
|
this.removeAll();
|
|
53647
53663
|
const stack = this.board.items.getUnderPointer();
|
|
53648
|
-
const top = stack.pop();
|
|
53664
|
+
const top = this.getSelectableItem(stack.pop());
|
|
53649
53665
|
if (top) {
|
|
53650
53666
|
this.add(top);
|
|
53651
53667
|
this.setContext("EditTextUnderPointer");
|
|
@@ -54255,7 +54271,7 @@ class BoardSelection {
|
|
|
54255
54271
|
selection: text5.editor.getSelection(),
|
|
54256
54272
|
ops
|
|
54257
54273
|
});
|
|
54258
|
-
tempStorage.
|
|
54274
|
+
tempStorage.setHorisontalAlignment(item.itemType, horisontalAlignment);
|
|
54259
54275
|
}
|
|
54260
54276
|
this.emitApplied({
|
|
54261
54277
|
class: "RichText",
|
|
@@ -55192,9 +55208,10 @@ class Board {
|
|
|
55192
55208
|
if (!item || !(item instanceof Group)) {
|
|
55193
55209
|
return;
|
|
55194
55210
|
}
|
|
55195
|
-
item.getChildren()
|
|
55196
|
-
|
|
55197
|
-
|
|
55211
|
+
const children = [...item.getChildren()];
|
|
55212
|
+
item.applyRemoveChildren(children.map((child) => child.getId()));
|
|
55213
|
+
children.forEach((child) => {
|
|
55214
|
+
child.transformation.isLocked = false;
|
|
55198
55215
|
});
|
|
55199
55216
|
item.transformation.isLocked = false;
|
|
55200
55217
|
const removedItems = [];
|
|
@@ -55209,9 +55226,7 @@ class Board {
|
|
|
55209
55226
|
if (!item || !(item instanceof Group)) {
|
|
55210
55227
|
return;
|
|
55211
55228
|
}
|
|
55212
|
-
item.
|
|
55213
|
-
item2.parent = "Board";
|
|
55214
|
-
});
|
|
55229
|
+
item.applyRemoveChildren(item.getChildrenIds());
|
|
55215
55230
|
const removedItems = [];
|
|
55216
55231
|
this.findItemAndApply(op.item, (item2) => {
|
|
55217
55232
|
this.index.remove(item2);
|
package/dist/cjs/index.js
CHANGED
|
@@ -7455,11 +7455,11 @@ class SessionStorage {
|
|
|
7455
7455
|
getFontHighlight(itemType) {
|
|
7456
7456
|
return this.get(`fontHighlightColor_${itemType}`);
|
|
7457
7457
|
}
|
|
7458
|
-
|
|
7459
|
-
this.set(`
|
|
7458
|
+
setHorisontalAlignment(itemType, horisontalAlignment) {
|
|
7459
|
+
this.set(`fontHorisontalAlignment_${itemType}`, horisontalAlignment);
|
|
7460
7460
|
}
|
|
7461
|
-
|
|
7462
|
-
return this.get(`
|
|
7461
|
+
getHorisontalAlignment(itemType) {
|
|
7462
|
+
return this.get(`fontHorisontalAlignment_${itemType}`);
|
|
7463
7463
|
}
|
|
7464
7464
|
setVerticalAlignment(itemType, verticalAlignment) {
|
|
7465
7465
|
this.set(`fontVerticalAlignment_${itemType}`, verticalAlignment);
|
|
@@ -17389,7 +17389,7 @@ class EditorContainer {
|
|
|
17389
17389
|
break;
|
|
17390
17390
|
case "setSelectionFontHighlight":
|
|
17391
17391
|
case "setSelectionFontStyle":
|
|
17392
|
-
case "
|
|
17392
|
+
case "setSelectionHorisontalAlignment":
|
|
17393
17393
|
this.applySelectionOp(op);
|
|
17394
17394
|
break;
|
|
17395
17395
|
case "setFontStyle":
|
|
@@ -21451,10 +21451,6 @@ class Items {
|
|
|
21451
21451
|
const unmodifiedSize = size;
|
|
21452
21452
|
size = 16;
|
|
21453
21453
|
const tolerated = this.index.getEnclosedOrCrossed(x - size, y - size, x + size, y + size);
|
|
21454
|
-
const groups = tolerated.filter((item) => item.itemType === "Group");
|
|
21455
|
-
if (groups.length > 0) {
|
|
21456
|
-
return groups;
|
|
21457
|
-
}
|
|
21458
21454
|
let enclosed = tolerated.some((item) => item instanceof Connector2) ? tolerated : this.index.getEnclosedOrCrossed(x, y, x, y);
|
|
21459
21455
|
const underPointer = this.getUnderPoint(new Point(x, y), size);
|
|
21460
21456
|
if (enclosed.length === 0) {
|
|
@@ -21994,6 +21990,20 @@ class BaseItem extends Mbr {
|
|
|
21994
21990
|
parentMatrix.apply(c);
|
|
21995
21991
|
return new Mbr(Math.min(corners[0].x, corners[1].x, corners[2].x, corners[3].x), Math.min(corners[0].y, corners[1].y, corners[2].y, corners[3].y), Math.max(corners[0].x, corners[1].x, corners[2].x, corners[3].x), Math.max(corners[0].y, corners[1].y, corners[2].y, corners[3].y));
|
|
21996
21992
|
}
|
|
21993
|
+
hasAncestor(itemId) {
|
|
21994
|
+
let parentId = this.parent;
|
|
21995
|
+
while (parentId && parentId !== "Board") {
|
|
21996
|
+
if (parentId === itemId) {
|
|
21997
|
+
return true;
|
|
21998
|
+
}
|
|
21999
|
+
const parent = this.board.items.getById(parentId);
|
|
22000
|
+
if (!parent || parent.parent === parentId) {
|
|
22001
|
+
break;
|
|
22002
|
+
}
|
|
22003
|
+
parentId = parent.parent;
|
|
22004
|
+
}
|
|
22005
|
+
return false;
|
|
22006
|
+
}
|
|
21997
22007
|
applyAddChildren(childIds) {
|
|
21998
22008
|
if (!this.index) {
|
|
21999
22009
|
return;
|
|
@@ -22001,7 +22011,7 @@ class BaseItem extends Mbr {
|
|
|
22001
22011
|
const containerNestingMatrix = this.getNestingMatrix();
|
|
22002
22012
|
childIds.forEach((childId) => {
|
|
22003
22013
|
const foundItem = this.board.items.getById(childId);
|
|
22004
|
-
if (this.parent !== childId && this.getId() !== childId) {
|
|
22014
|
+
if (this.parent !== childId && this.getId() !== childId && !this.hasAncestor(childId)) {
|
|
22005
22015
|
if (!this.index?.getById(childId) && foundItem) {
|
|
22006
22016
|
const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
|
|
22007
22017
|
this.board.items.index.remove(foundItem);
|
|
@@ -22496,12 +22506,14 @@ class RichText extends BaseItem {
|
|
|
22496
22506
|
top = container.top;
|
|
22497
22507
|
}
|
|
22498
22508
|
const point3 = new Point(left, top);
|
|
22499
|
-
this.
|
|
22509
|
+
if (!this.isInShape || this.autoSize) {
|
|
22510
|
+
this.getParentWorldMatrix().apply(point3);
|
|
22511
|
+
}
|
|
22500
22512
|
return {
|
|
22501
22513
|
point: point3,
|
|
22502
22514
|
width,
|
|
22503
22515
|
height,
|
|
22504
|
-
maxWidth: maxWidth ? maxWidth
|
|
22516
|
+
maxWidth: maxWidth ? maxWidth : undefined,
|
|
22505
22517
|
maxHeight,
|
|
22506
22518
|
textScale: this.isInShape && !this.autoSize ? 1 : this.getScale()
|
|
22507
22519
|
};
|
|
@@ -40189,6 +40201,7 @@ class Shape extends BaseItem {
|
|
|
40189
40201
|
this.text.deserialize(data.text);
|
|
40190
40202
|
}
|
|
40191
40203
|
this.transformPath();
|
|
40204
|
+
this.text.updateElement();
|
|
40192
40205
|
this.subject.publish(this);
|
|
40193
40206
|
return this;
|
|
40194
40207
|
}
|
|
@@ -43686,6 +43699,7 @@ class Group extends BaseItem {
|
|
|
43686
43699
|
constructor(board, events, children = [], id = "") {
|
|
43687
43700
|
super(board, id, undefined, true);
|
|
43688
43701
|
this.events = events;
|
|
43702
|
+
this.canBeNested = true;
|
|
43689
43703
|
this.linkTo = new LinkTo(this.id, this.events);
|
|
43690
43704
|
this.transformation = new Transformation(this.id, this.events);
|
|
43691
43705
|
this.transformation.subject.subscribe(() => {
|
|
@@ -47114,7 +47128,8 @@ class Select extends Tool {
|
|
|
47114
47128
|
this.beginTimeStamp = Date.now();
|
|
47115
47129
|
const selectionMbr = selection.getMbr();
|
|
47116
47130
|
const selectionItems = selection.list();
|
|
47117
|
-
|
|
47131
|
+
const selectableHover = hover.map((item) => this.board.selection.getSelectableItem(item));
|
|
47132
|
+
this.isDownOnSelection = selectionMbr !== undefined && selectionMbr.isUnderPoint(pointer.point) && selectableHover.every((hovered) => hovered && selectionItems.some((selected) => selected.getId() === hovered.getId()));
|
|
47118
47133
|
this.isDraggingSelection = this.isDownOnSelection;
|
|
47119
47134
|
if (this.isDraggingSelection) {
|
|
47120
47135
|
this.board.selection.transformationRenderBlock = true;
|
|
@@ -47440,7 +47455,7 @@ class Select extends Tool {
|
|
|
47440
47455
|
const hovered = this.board.items.getUnderPointer();
|
|
47441
47456
|
this.board.pointer.subject.publish(this.board.pointer);
|
|
47442
47457
|
if (isCtrl || isShift) {
|
|
47443
|
-
const underPointer = hovered[0];
|
|
47458
|
+
const underPointer = this.board.selection.getSelectableItem(hovered[0]);
|
|
47444
47459
|
const isEmptySelection = this.board.selection.items.list().length === 0;
|
|
47445
47460
|
if (!underPointer && !isEmptySelection && isShift) {
|
|
47446
47461
|
this.board.selection.add(this.board.selection.items.list());
|
|
@@ -47456,14 +47471,6 @@ class Select extends Tool {
|
|
|
47456
47471
|
const isNotInSelection = this.board.selection.items.findById(underPointer.getId()) === null;
|
|
47457
47472
|
if (isNotInSelection) {
|
|
47458
47473
|
this.board.selection.add(underPointer);
|
|
47459
|
-
if ("index" in underPointer && underPointer.index) {
|
|
47460
|
-
const { left, right, top, bottom } = underPointer.getMbr();
|
|
47461
|
-
const childrenIds = underPointer.getChildrenIds();
|
|
47462
|
-
console.log("UNDERPOINTER", underPointer);
|
|
47463
|
-
console.log("CHILDREN", childrenIds);
|
|
47464
|
-
const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => childrenIds && childrenIds.includes(item.getId()));
|
|
47465
|
-
this.board.selection.add(itemsInFrame);
|
|
47466
|
-
}
|
|
47467
47474
|
this.board.selection.setContext("EditUnderPointer");
|
|
47468
47475
|
} else {
|
|
47469
47476
|
this.board.selection.remove(underPointer);
|
|
@@ -47480,10 +47487,6 @@ class Select extends Tool {
|
|
|
47480
47487
|
} else {
|
|
47481
47488
|
this.board.selection.editUnderPointer();
|
|
47482
47489
|
}
|
|
47483
|
-
if (topItem2 instanceof Group) {
|
|
47484
|
-
const groupChildren = topItem2.getChildren();
|
|
47485
|
-
this.board.selection.add(groupChildren);
|
|
47486
|
-
}
|
|
47487
47490
|
this.board.tools.publish();
|
|
47488
47491
|
this.clear();
|
|
47489
47492
|
return false;
|
|
@@ -53519,10 +53522,23 @@ class BoardSelection {
|
|
|
53519
53522
|
getMbr() {
|
|
53520
53523
|
return this.items.getMbr();
|
|
53521
53524
|
}
|
|
53525
|
+
getSelectableItem(item) {
|
|
53526
|
+
if (!item) {
|
|
53527
|
+
return null;
|
|
53528
|
+
}
|
|
53529
|
+
if (!(item instanceof BaseItem) || item.parent === "Board") {
|
|
53530
|
+
return item;
|
|
53531
|
+
}
|
|
53532
|
+
const parent = this.board.items.getById(item.parent);
|
|
53533
|
+
if (parent instanceof Group) {
|
|
53534
|
+
return parent;
|
|
53535
|
+
}
|
|
53536
|
+
return item;
|
|
53537
|
+
}
|
|
53522
53538
|
selectUnderPointer() {
|
|
53523
53539
|
this.removeAll();
|
|
53524
53540
|
const stack = this.board.items.getUnderPointer();
|
|
53525
|
-
const top = stack.pop();
|
|
53541
|
+
const top = this.getSelectableItem(stack.pop());
|
|
53526
53542
|
if (top) {
|
|
53527
53543
|
this.add(top);
|
|
53528
53544
|
this.setTextToEdit(undefined);
|
|
@@ -53576,7 +53592,7 @@ class BoardSelection {
|
|
|
53576
53592
|
editUnderPointer() {
|
|
53577
53593
|
this.removeAll();
|
|
53578
53594
|
const stack = this.board.items.getUnderPointer();
|
|
53579
|
-
const item = stack.pop();
|
|
53595
|
+
const item = this.getSelectableItem(stack.pop());
|
|
53580
53596
|
if (item) {
|
|
53581
53597
|
this.add(item);
|
|
53582
53598
|
this.setTextToEdit(undefined);
|
|
@@ -53610,7 +53626,7 @@ class BoardSelection {
|
|
|
53610
53626
|
const textSize = tempStorage.getFontSize(item.itemType);
|
|
53611
53627
|
const highlightColor = tempStorage.getFontHighlight(item.itemType);
|
|
53612
53628
|
const styles = tempStorage.getFontStyles(item.itemType);
|
|
53613
|
-
const
|
|
53629
|
+
const horisontalAlignment = tempStorage.getHorisontalAlignment(item.itemType);
|
|
53614
53630
|
const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
|
|
53615
53631
|
if (textColor) {
|
|
53616
53632
|
text5.setSelectionFontColor(textColor, "None");
|
|
@@ -53631,8 +53647,8 @@ class BoardSelection {
|
|
|
53631
53647
|
const stylesArr = styles;
|
|
53632
53648
|
text5.setSelectionFontStyle(stylesArr, "None");
|
|
53633
53649
|
}
|
|
53634
|
-
if (
|
|
53635
|
-
text5.setSelectionHorisontalAlignment(
|
|
53650
|
+
if (horisontalAlignment && !(item instanceof Sticker)) {
|
|
53651
|
+
text5.setSelectionHorisontalAlignment(horisontalAlignment);
|
|
53636
53652
|
}
|
|
53637
53653
|
if (verticalAlignment && !(item instanceof Sticker)) {
|
|
53638
53654
|
this.setVerticalAlignment(verticalAlignment);
|
|
@@ -53645,7 +53661,7 @@ class BoardSelection {
|
|
|
53645
53661
|
editTextUnderPointer() {
|
|
53646
53662
|
this.removeAll();
|
|
53647
53663
|
const stack = this.board.items.getUnderPointer();
|
|
53648
|
-
const top = stack.pop();
|
|
53664
|
+
const top = this.getSelectableItem(stack.pop());
|
|
53649
53665
|
if (top) {
|
|
53650
53666
|
this.add(top);
|
|
53651
53667
|
this.setContext("EditTextUnderPointer");
|
|
@@ -54255,7 +54271,7 @@ class BoardSelection {
|
|
|
54255
54271
|
selection: text5.editor.getSelection(),
|
|
54256
54272
|
ops
|
|
54257
54273
|
});
|
|
54258
|
-
tempStorage.
|
|
54274
|
+
tempStorage.setHorisontalAlignment(item.itemType, horisontalAlignment);
|
|
54259
54275
|
}
|
|
54260
54276
|
this.emitApplied({
|
|
54261
54277
|
class: "RichText",
|
|
@@ -55192,9 +55208,10 @@ class Board {
|
|
|
55192
55208
|
if (!item || !(item instanceof Group)) {
|
|
55193
55209
|
return;
|
|
55194
55210
|
}
|
|
55195
|
-
item.getChildren()
|
|
55196
|
-
|
|
55197
|
-
|
|
55211
|
+
const children = [...item.getChildren()];
|
|
55212
|
+
item.applyRemoveChildren(children.map((child) => child.getId()));
|
|
55213
|
+
children.forEach((child) => {
|
|
55214
|
+
child.transformation.isLocked = false;
|
|
55198
55215
|
});
|
|
55199
55216
|
item.transformation.isLocked = false;
|
|
55200
55217
|
const removedItems = [];
|
|
@@ -55209,9 +55226,7 @@ class Board {
|
|
|
55209
55226
|
if (!item || !(item instanceof Group)) {
|
|
55210
55227
|
return;
|
|
55211
55228
|
}
|
|
55212
|
-
item.
|
|
55213
|
-
item2.parent = "Board";
|
|
55214
|
-
});
|
|
55229
|
+
item.applyRemoveChildren(item.getChildrenIds());
|
|
55215
55230
|
const removedItems = [];
|
|
55216
55231
|
this.findItemAndApply(op.item, (item2) => {
|
|
55217
55232
|
this.index.remove(item2);
|